You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2013/04/18 20:00:24 UTC

[jira] [Resolved] (CB-3068) Android menu not appearing as actionoverflow

     [ https://issues.apache.org/jira/browse/CB-3068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-3068.
----------------------------

    Resolution: Won't Fix

This is an Android issue, not a PhoneGap issue.  All we do on onCreateOptionsMenu, onPrepareOptionsMenu and onOptionsItemSelected is provide hooks for third party plugins to be used and fire events that the menu button was pressed.

[~macdonst] has a tutorial on how to do this in Java here, http://simonmacdonald.blogspot.com/2012/11/building-native-menu-with-phonegap.html

I have an example of how to use CordovaWebView with a native action bar, which also has a menu.  This can be found here: https://github.com/infil00p/CordovaActionView


                
> Android menu not appearing as actionoverflow
> --------------------------------------------
>
>                 Key: CB-3068
>                 URL: https://issues.apache.org/jira/browse/CB-3068
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.6.0
>         Environment: Android
>            Reporter: Umang Kedia
>            Assignee: Joe Bowser
>            Priority: Minor
>
> The android native menu is not opening when pressing menu button while using PhoneGap. When I am pressing menu button, onCreateOptionsMenu() method is getting called but the menu is not getting created. 
> public class PhoneGapActivity extends DroidGap {
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.setBooleanProperty("showTitle", true);
>         super.onCreate(savedInstanceState);
>         super.loadUrl("file:///android_asset/www/index.html");
>     }
>     @Override
>     public boolean onCreateOptionsMenu(Menu menu) {
>         // Inflate the menu; this adds items to the action bar if it is present.
>         super.onCreateOptionsMenu(menu);
>         Log.d("Menu","Menu option called");
>         getMenuInflater().inflate(R.menu.phone_gap, menu);
>         return true;
>     }
> }
> The log is getting printed, that means the function is getting called.
> XML file for menu: When the android:showAsAction is set to always, its showing in the action bar, otherwise its not showing in the actionoverflow.
> <menu xmlns:android="http://schemas.android.com/apk/res/android" >
>     <item
>         android:id="@+id/action_settings"
>         android:icon="@drawable/ic_menu_settings_holo_light"
>         android:showAsAction="always"
>         android:title="@string/action_settings"/>
>     <item
>         android:id="@+id/more"
>         android:icon="@drawable/ic_menu_moreoverflow_normal_holo_light"
>         android:showAsAction="never"
>         android:title="@string/more"/>
> </menu>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira