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. Slider devices cause Activi ties to reset鈥

Read about the mainfest activity setting "android:configChanges"
http://developer.android.com/guide/topics/manifest/activity-element.html
http://developer.android.com/guide/topics/manifest/activity-element.html#config





-- 

2. Exception in the bowels of Contact Manager?

Hello, got the error below reported to me when reading a Contact.  I
am clueless as to what the problem.  The same code works almost every
time as I've only had this one report and I've never seen it happen
during testing.

The query I am exectuing is simply:

context.getContentResolver().query(Uri.parse(token), null, null, null,
null)

The token is just the URI originally obtained using
RawContacts.getContactLookupUri()

Anybody has any ideas what the problem could be or how to debug this?

Thanks!


java.lang.IllegalStateException: Couldn't init cursor window
at android.os.Parcel.readException(Parcel.java:1255)
at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
160)
at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
114)
at
android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:
372)
at
android.content.ContentProviderProxy.query(ContentProviderNative.java:
408)
at android.content.ContentResolver.query(ContentResolver.java:245)
at
com.zvasvari.anmoneyp.devicecontacts.android5contacts.ContactsImpl.existsByToken(ContactsImpl.java:
331)
at
com.zvasvari.anmoneyp.app.contact.payee.activity.PayeeUtil.isExternal(PayeeUtil.java:
208)
at
com.zvasvari.anmoneyp.app.contact.payee.activity.List.isExternal(List.java:
51)
at
com.zvasvari.anmoneyp.app.contact.activity.List.bindListItemView(List.java:
411)
at com.zvasvari.anmoneyp.app.contact.activity.List
$2.bindView(List.java:390)

-- 

3. Android framework Java sources

4. Slider devices cause Activities to reset鈥

5. latest ffmpeg for android

6. Porting issues cannot be solved

7. Loading Dialog/Html TextBox/Virtual Keyboard