0
任何人都可以找出为什么这会导致一个力量关闭?强力关闭试图启动一个市场页面和提示框
void failbox(){
// Create the alert box
AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
// Set the message to display
alertbox.setMessage(R.string.fail);
alertbox.setPositiveButton("Get Busybox", new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("market://details?id=stericson.busybox"));
}
});
// set a negative/no button and create a listener
alertbox.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
}
});
// show the alert box
alertbox.show();
}
在此先感谢!
什么是“本” ......鼠标移到它的上下文。这是一个活动吗? – 2011-04-11 22:55:35
我很遗憾地被你的问题困惑......哈哈。你能详细说明一下吗? – 2011-04-11 22:58:58