L
L
llxff2011-06-02 15:44:25
Android
llxff, 2011-06-02 15:44:25

Android, onCreateOptionsMenu not firing?

In general, a simple example:

package com.example;<br/>
<br/>
import android.app.Activity;<br/>
import android.os.Bundle;<br/>
import android.view.Menu;<br/>
<br/>
public class MyActivity extends Activity<br/>
{<br/>
 @Override<br/>
 public void onCreate(Bundle savedInstanceState)<br/>
 {<br/>
 super.onCreate(savedInstanceState);<br/>
 setContentView(R.layout.main);<br/>
 }<br/>
<br/>
@Override<br/>
 public boolean onCreateOptionsMenu(Menu menu)<br/>
 {<br/>
 super.onCreateOptionsMenu(menu);<br/>
 menu.add(&quot;qwerty&quot;);<br/>
 return true;<br/>
 }<br/>
}<br/>

In the emulator 1.6, the menu is shown, in the emulator and the phone with 2.2 it is not shown. What could be the reason?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question