Reputation: 14033
I have the following activity...
package org.dewsworld;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
public class MenuActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater() ;
inflater.inflate(R.menu.main_menu, menu) ;
return true;
}
}
ad my main_menu.xml is
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/item1" android:title="Home"></item>
<item android:id="@+id/item2" android:title="Client List"></item>
<item android:id="@+id/item3" android:title="Amar matha"></item>
<item android:id="@+id/item4" android:title="Tomar matha"></item>
</menu>
And my logcat report is Please help...
Upvotes: 0
Views: 678
Reputation: 15079
Some question beforehand:
main_menu.xml
put in correct directory?Upvotes: 1
Reputation: 8546
Build and clean your project first...
If the problem persist check the Resource Id #0x7f050000 in packagename.R.id.NAME_String
You would get the name of Resource value that is creating problem... Delete all it;s references create newer and then clean and run the project...
In precise way... Try to use Debud Perspectives to solve your minor faults
With Regards,
Arpit
Upvotes: 2