闹钟

来源:互联网 发布:linux使用vnc的要求 编辑:程序博客网 时间:2024/04/28 05:40

http://aswang.iteye.com/blog/875863


//声明进度条对话框
ProgressDialog m_pDialog;


class mtThread extends Thread{
ProgressDialog mDialog;


public mtThread(ProgressDialog mDialog) {
super();
this.mDialog = mDialog;
}




@Override
public void run() {
try {
sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mDialog.cancel();
Log.d("hu", "hhhuhu");
}

}
/** Called when the activity is first created. */
    @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test);


m_pDialog = new ProgressDialog(testActivity.this);
m_pDialog.setMessage("这是一个圆形进度条对话框");
m_pDialog.setIndeterminate(false);
m_pDialog.setCancelable(true);
m_pDialog.setButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int i) {
dialog.cancel();
}
});
m_pDialog.show();
new mtThread(m_pDialog).start();

}

原创粉丝点击