Hi Question about menu

by 鏅鸿秴 钖 » Fri, 23 Apr 2010 08:05:08 GMT


Sponsored Links
 i want to realize button pop-up optionmenu,

i write a button setOnClickListener, check this could pop-up menu ,

how to made it?

my code is:

case R.id.tools:
if(myMenu==null) {
                                        myMenu.add(0, 0, 0, 
"Add").setIcon(R.drawable.addfolderr);
                                        myMenu.add(0, 1, 0, 
"Delete").setIcon(R.drawable.delete);

                                }
                                onCreateOptionsMenu(myMenu);
                                break;
but method onCreateOptionsMenu(menu) not work;
type System.out.println("12334"); it could print ,but the menu not
work:(
anyone know how to make it work? or  had other way to pop-up menu

--



Hi Question about menu

by ~ TreKing » Fri, 23 Apr 2010 10:19:22 GMT


 




Try checking if (myMenu != null), since, you know, you probably want a valid
object to add stuff to.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--


Sponsored Links


Other Threads

1. Web Page Not Available -- help?!

Hi - Same problem-  HelloWebview code (and other WebView code samples)
all result in "web page not available" error.

Javascript is enabled

Permissions set for INTERNET, ACCESS_NETWORK_STATE,
CHANGE_NETWORK_STATE in Manifest.xml.

Does not work on either emulator or device (Samsung Moment -- Android
1.5)

GOOGLE.com comes up on both emulator and device.

I have looked for s solution for this for several days.

Please help--  I'm a real newbie to Android, and a pretty new user of
JAVA but can follow an example / sample.

Thank you for any help !
David

-- 

2. Where can I find the Adwhirl SDK for Android ?

Hi,

Checked for SDK at
http://code.google.com/p/adwhirl/downloads/list but could'nt find the
SDK for Android.

-- 

3. Fwd: Google Docs

4. getView() multiple call details

5. How to read xml data (Text + Images) and display

6. How do I modify the -encoding argument to javac in the Android Ant build system

7. Are processes kept alive when nothing is being done?