如题,怎样让程序在执行都某个地方,比如,当程序运行时间超过给定时间的时候,自动弹出时间到对话框?
解决方案 »
- 关于SQLiteTableLockedException
- 在PreferenceActivity里面如何让EditTextPreference值保存下来
- android系统移植问题
- android网络应用问题
- 请教一个问题
- android用robotium测试apk签名问题
- 我在做安卓开发百度地图下面的代码为什么会报错啊,求大神指点, 急啊!!!!
- 新人求助帖,第一搞
- 如何在锁屏后还能够更新GPS定位?
- 求大神:新建android项目时,总是出错,说是The import android.support cannot be resolved,不知道怎么解决。
- 调用第二个 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();
}