如题,怎样让程序在执行都某个地方,比如,当程序运行时间超过给定时间的时候,自动弹出时间到对话框?
解决方案 »
- android activity类实现了OnScrollListener接口时,listview滑到最低端时报错
- android登录,用什么代替验证码?
- 百度api RouteOverlay的问题
- ffmpeg播放问题
- 不同包之间数据传递的问题
- 读取通讯录联系人很慢的问题
- android手机识别商品条码查询商品信息(求:如何查询)
- Android:如何用动图做按钮的背景?
- 分析log方法
- 能不能设置Scroller多次滑动?
- 调用第二个 activity 设 myView.setText(R.string.hello_world); 出错,高手请进!
- 急,关于webview的空指针,求原因!!
我的代码:
1113 AlertDialog dialog;
1114 dialog = builder.create();
调试信息:
11-26 11:22:09.689: E/AndroidRuntime(5686): at aliao.wb.MySurfaceView.DialogPass(MySurfaceView.java:1114)
AlertDialog.Builder builder = null;
builder = new AlertDialog.Builder(this.getContext());
// 实例化Builder对象
builder = new AlertDialog.Builder(this.getContext());
LayoutInflater factory = LayoutInflater.from(this.getContext());
View textEntryView = factory.inflate(R.layout.passdialog, null);
builder.setView(textEntryView); // 绑定
ibtnRetry = (ImageButton) textEntryView.findViewById(R.id.btnRetry);
ibtnRetry.setOnTouchListener(new OnTouchListener() { @Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN)
ibtnRetry.setBackgroundDrawable(getResources()
.getDrawable(R.drawable.retry_pressed));
else if (event.getAction() == MotionEvent.ACTION_UP)
ibtnRetry.setBackgroundDrawable(getResources()
.getDrawable(R.drawable.retry));
return false;
}
});
// 显示对话框
AlertDialog dialog = null;
dialog = builder.create();
System.out.println("dialog creat sussessed!");
dialog.show();
builder = null;
//builder.create().show();
}