Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-1795

onCreateOptionsMenu in PhoneGap 2.2.0 Release Candidate 2 isn't working anymore

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: cordova-android
    • Labels:
      None
    • Environment:

      Samsung Galaxy S2 with Android 4.0.4
      About my device: my device has stock Android, but it's rooted.

      Description

      The menu doesn't show anymore.
      This is my code:

      package com.test.test.project;

      import android.os.Bundle;
      import android.view.Menu;
      import android.view.MenuInflater;
      import android.view.MenuItem;
      import android.view.WindowManager;
      import org.apache.cordova.*;

      public class MainActivity extends DroidGap
      {
      @Override
      public void onCreate(Bundle savedInstanceState)

      { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/www/index.html"); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }

      @Override
      public boolean onCreateOptionsMenu(Menu menu)

      { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; }

      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId())

      { case R.id.close: finish (); break; }

      return true;
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              macdonst Simon MacDonald
              Reporter:
              remzicavdar Remzi Cavdar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: