我遇到的问题是:我有这个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模拟器时,popUp不会显示自己,并且日志中会显示以下行...
[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!
这很糟糕,因为我想检查这个愚蠢的事情,但我有点被困......
答案 0 :(得分:0)
您的模拟器未运行,或者您与ADB的连接已损坏或已过时。解决这个问题:
如果仍然无效,请检查运行和调试配置,确保它们指向正确的模拟器。