Hello,
If you want the menu to be access available to the user as long as the app 
is up, then you can have it as an actionbar item instead of as the menu 
option. 
You can view it via a simple icon or show/hide it depending upon the room 
on the user interface.

On Thursday, 8 August 2013 15:20:25 UTC+5:30, drenda wrote:
>
> Hi,
> I've a problem with Option menu and focus.
> I've a simple View in which I've some data come from remote service. I've 
> to display an icon of the option menu only sometimes when remote object has 
> some characteristics.
>
> So I do this:
>
> @Override
>     public boolean onCreateOptionsMenu(Menu menu) {
>         return true;
>     }
>
>     @Override    public boolean onPrepareOptionsMenu(Menu menu) {
>
>
>         if (corsa != null && corsa.getDataPartenzaEffettiva() == null) {
>             menu.clear();
>             getMenuInflater().inflate(R.menu.dettaglio_corsa, menu);
>         }
>         return true;
>     }
>
> The first time I create an empty menu and then when I receive remote data 
> (asyncCall) I call   invalidateOptionsMenu(); so I display the option menu 
> icon. All works fine but in this view I open programatically the keyboard:
>
>  InputMethodManager inputMethodManager = (InputMethodManager) 
> getSystemService(Context.INPUT_METHOD_SERVICE);
>         if (inputMethodManager != null) {
>             
> inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
>         }
>
> the problem is that every time I press a key on the keyboard the icon of 
> Option menu focus, and when I press "enter" the option menu is clickked. I 
> don't want this, why the option menu is focused every time I press a key?
>
> Thanks
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to