I am developing an android app supporting API-9, the action bar with the name of the app appear but the problem is that items doesn't appear this is the menu file:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- http://schemas.android.com/apk/lib/com.fakher.actualitefoot -->
<!-- Settings -->
<item
android:id="@+id/action_refresh"
android:icon="@drawable/ic_action_settings"
android:title="@string/action_settings"
app:showAsAction="never|withText" />
<!-- Check updates -->
<item
android:id="@+id/action_check_updates"
android:icon="@drawable/ic_action_refresh"
android:title="@string/action_check_updates"
app:showAsAction="never|withText" />
</menu>
the main class:
public class MainActivity extends FragmentActivity {
private final Handler handler = new Handler();
private PagerSlidingTabStrip tabs;
private ViewPager pager;
private PagerAdapter adapter;
private AdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
....
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}
private Drawable.Callback drawableCallback = new Drawable.Callback() {
@Override
public void invalidateDrawable(Drawable who) {
getActionBar().setBackgroundDrawable(who);
}
@Override
public void scheduleDrawable(Drawable who, Runnable what, long when) {
handler.postAtTime(what, when);
}
@Override
public void unscheduleDrawable(Drawable who, Runnable what) {
handler.removeCallbacks(what);
}
};
@Override
public void onPause() {
adView.pause();
super.onPause();
}
@Override
public void onResume() {
super.onResume();
adView.resume();
}
@Override
public void onDestroy() {
adView.destroy();
super.onDestroy();
}
}
stykes.xml :
<resources>
<style name="AppBaseTheme" parent="android:Theme.Light"></style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowBackground">@color/background_window</item>
<item name="android:actionBarStyle">@style/ActionBarStyle</item>
</style>
<style name="ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<!--<item name="android:icon">@drawable/ic_launcher</item>-->
<item name="android:background">#ff127d08</item>
</style>
</resources>
i want that the action bar show the menu containing items declared in the menu file Thx :)