Your AlertDialog doesn't call the method show();
 
new AlertDialog.Builder(this).setTitle("About").setMessage("el viva Android  
!").create().show(); 

it is work well;

please be careful ;
------------------ 原始邮件 ------------------
发件人: "冉峻萍"<[email protected]>;
发送时间: 2012年5月14日(星期一) 中午12:32
收件人: "android-developers"<[email protected]>; 

主题: Re: [android-developers] Menu : Handling click events : DialogBox



在 2012-5-12 下午6:23,"huberte" <[email protected]>写道:
 
Hi, I did red

 http://developer.android.com/guide/topics/ui/menus.html
 
http://developer.android.com/guide/topics/resources/menu-resource.html
 
I wrote this in main activity

 
@Override   
 public boolean onCreateOptionsMenu(Menu menu) {
     MenuInflater inflater = getMenuInflater();
     inflater.inflate(R.menu.mainmenu, menu);
     return true;
 }
@Override
 public boolean onOptionsItemSelected(MenuItem item) {
     // Handle item selection
    switch (item.getItemId()) {
         case R.id.infos:
             infos();
            return true;
         case R.id.waring:
             waring();
            return true;
         case R.id.credits:
             credits();
            return true;
         case R.id.about:
             about();
            return true;
         default:
             return super.onOptionsItemSelected(item);
     }
}
 private void about() {
 //      // TODO Auto-generated method stub
//      // custom dialog
 
}


 Where shoudd I put my alertbox (is this correct for a simple text box with no 
button ?) :

 
new AlertDialog.Builder(this).setTitle("About").setMessage("el viva Android  
!").create(); 




 in private void about(), which never works

or directly in case R.id.about: about();

 Quit lost here.

thks



 

 

 -- 
 You received this message because you are subscribed to the Google
 Groups "Android Developers" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to
 [email protected]
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 

 -- 
 You received this message because you are subscribed to the Google
 Groups "Android Developers" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to
 [email protected]
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to