我的问题是以下一个:我有这个Java代码......
Button boton = (Button) this.findViewById(R.id.button1);
boton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
AlertDialog.Builder builderDlg = new AlertDialog.Builder(MainActivity.this);
builderDlg.setTitle("Exit");
builderDlg.setMessage("¿Usted quiere retirarse?");
builderDlg.setCancelable(false);
builderDlg.setPositiveButton("Si",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
MainActivity.this.finish();
}
});
builderDlg.setNegativeButton("No",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
}
});
当我启动 Android Emulator 时,弹出窗口不显示,日志中出现以下行...
[2013-02-17 19:35:33 - DialogPopUp] Failed to install DialogPopUp.apk on device 'emulator-5554': device not found
[2013-02-17 19:35:33 - DialogPopUp] com.android.ddmlib.InstallException: device not found
[2013-02-17 19:35:33 - DialogPopUp] Launch canceled!
很遗憾,因为我想检查这个愚蠢的东西,但我有点卡住了......