1. Are you ready for the Galaxy S20? Here is everything we know so far!

Having problem with R.menu

Discussion in 'Android Apps & Games' started by arash.moeen, May 18, 2011.

  1. arash.moeen

    arash.moeen Lurker
    Thread Starter

    I've been trying to learn about menus in android and just got this example.

    Code (Text):
    1. package de.vogella.android.menuitem;
    2.  
    3. import android.app.Activity;
    4. import android.os.Bundle;
    5. import android.view.Menu;
    6. import android.view.MenuInflater;
    7.  
    8.  
    9.  
    10.  
    11.  
    12. public class MainActivity extends Activity {
    13.     /** Called when the activity is first created. */
    14.     @Override
    15.     public void onCreate(Bundle savedInstanceState) {
    16.         super.onCreate(savedInstanceState);
    17.         setContentView(R.layout.main);
    18.     }
    19.    
    20.     @Override
    21.     public boolean onCreateOptionsMenu(Menu menu) {
    22.         MenuInflater inflater = getMenuInflater();
    23.         inflater.inflate(R.menu.game_menu, menu);
    24.         return true;
    25.     }
    26. }
    but somehow for some unknown reason to me the R.menu gives me an error on the word menu and it say it can't be resolved, any idea ? thnx in advance
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...