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...
Similar Threads - Having problem menu
  1. Mohamed13
    Replies:
    6
    Views:
    557
  2. Cinque8
    Replies:
    9
    Views:
    428
  3. Terrimerr
    Replies:
    13
    Views:
    278
  4. varamilc
    Replies:
    7
    Views:
    629
  5. matthewatlant0s
    Replies:
    4
    Views:
    796
  6. Sidney Menough
    Replies:
    1
    Views:
    625
  7. GoofyMD
    Replies:
    9
    Views:
    1,237
  8. FoxRio
    Replies:
    6
    Views:
    5,985
  9. dex2908
    Replies:
    1
    Views:
    2,513
  10. Alissa Smith
    Replies:
    0
    Views:
    480

Share This Page

Loading...