2

次のアプリがあります。私は非常に単純なことをしようとしています。開始時にアラートを表示するだけです。しかし、それはちょうどこのメッセージを示しています

"[2012-04-13 17:38:23 - HelloDriod] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=hellodriod.hello/.HelloDriodActivity }
[2012-04-13 17:38:23 - HelloDriod] ActivityManager: Warning: Activity not started, its current task has been brought to the front"

エミュレーターでは、 project name と blank screen だけが表示されます。何か不足していますか?任意の指示をいただければ幸いです。

package hellodriod.hello;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;



public class HelloDriodActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage("Are you sure you want to exit?")
               .setCancelable(false)
               .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {

                   }
               })
               .setNegativeButton("No", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {
                        dialog.cancel();
                   }
               });
        AlertDialog alert = builder.create();

    }
}
4

2 に答える 2

5

実際にはダイアログを表示していません。

alert.show();
于 2012-04-13T21:44:57.467 に答える
1

表示されるメッセージは、コンパイルする新しいものは何もないことを示しているだけです。すでに最新バージョンを実行していて、デバイスに表示されています。

于 2012-04-13T21:45:21.633 に答える