Android 强制关闭尝试从和警报框启动市场页面
有人知道为什么这会导致力闭合吗Android 强制关闭尝试从和警报框启动市场页面,android,Android,有人知道为什么这会导致力闭合吗 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
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();
}
提前谢谢 如果你在模拟器中得到了强制关闭,我能告诉你的就是这样。您无法从模拟器通过市场应用程序访问市场 在真正的Android设备上运行时,你的应用程序是否仍会崩溃
(当然,有些人已经想出了通过模拟器进入市场的鬼鬼祟祟的方法。请参阅)这是什么意思。。。鼠标放在上面。这是一项活动吗?很遗憾,我被你的问题弄糊涂了。。。哈哈。你能详细说明一下吗?