This is my little code :
options.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
mActivity.openOptionsMenu();
}
});
}
});
I was using the android standard emulator.. when pressing the physical
button it show the menu. However when I do it directly for the first
time programmaticaly it rises an exception !
On 24 fév, 16:01, skink <[email protected]> wrote:
> On Feb 24, 3:18 pm, Houcem Berrayana <[email protected]>
> wrote:
>
> > I have some issue. When I invoke this method I get
> > NullPointerException !!
> > If I press Menu button (the real one). It appears without any
> > problems. After showing this menu once and when invoking
> > showOptionsMenu programmatically I don't get any exception!! I that an
> > android bug?? It's seems like the menu is not created when I invoke
> > that programmatically for the first time!
>
> when do you call showOptionsMenu for the first time?
>
> pskink
--
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