2012-04-13 17 views
2

私は次のアプリを持っています。私は非常に簡単なことをしようとしています。起動時に警告を表示するだけです。しかし、それだけでこのメッセージが表示されます。簡単なAndroidアプリのダイアログは表示されませんか?

"[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" 

エミュレータでは、プロジェクト名と空白の画面が表示されます。私は何か不足していますか?どの方向にも感謝します。

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(); 

    } 
} 

答えて

5

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

alert.show(); 
1

あなただけコンパイルするために、新しいものは何も存在しないことを通知され得るメッセージが、あなたはすでに、今お使いのデバイスに表示されている最新バージョンを実行しています。

関連する問題