I have managed to mess up one my Android projects, by removing something (i suspect). Below are my manifests and menu resource's. For some reason my action bar is not displaying the menu button when I run the application.
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_settings"
android:title="@string/menu_settings"
android:orderInCategory="100"
android:showAsAction="never" />
</menu>
Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="6"
android:versionName="2.1.0" >
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="@string/title_activity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I also have this in my Activity code
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.menu_settings:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
But still no menu/option button is created when the application runs. Any idea's?
Edit 1
After some major trial an error i have discovered that adding localization support to my application has caused the issue.
I removed the all localized values-* directories and the Action Bar came back, i then copied the values directory to values-en and ran it on my English device. The action bar then disappeared. Does this shed any light for anyone?