After hours of browsing the internet, I am still having a problem showing a menu on my app.
I have a viewflipper with in it several scrollviews and they have several layouts as well.
The whole app works great, I can swipe from scrollview to scrollview without any problems.
Before I connected a Samsung Galaxy Tab to play with, I was running the app in the emulator. There if I pressed the menu button, the submenu was showing and I was able to run functions on menu item touch.
On the tablet, the menu is not showing anywhere.
Here is my menu file:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/KPNsites"
android:icon="@drawable/ic_menu_name"
android:title="KPN Sites"/>
<item
android:id="@+id/VDFsites"
android:icon="@drawable/ic_menu_name"
android:title="Vodafone sites"/>
</menu>
In my activity I have this code:
@Override
public boolean onCreateOptionsMenu(Menu my_menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, my_menu);
return super.onCreateOptionsMenu(my_menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.KPNsites:
getKPNsiteInfo();
return true;
case R.id.VDFsites:
getVodafoneSiteInfo();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
When I run the app on the tablet, I only have a small bar at the top with only te app-name in it. I suspect the menu should be visible on that bar?
What else should I do / have done (differently)??
rg,
Eric
well gave it up for now.
every try messes up what I already got.
To get by, I’ve put buttons on the layout.
May be with the next project I get it working.
(but then by starting with it before I have all my layouts finished)
Thanks for the help!
rg,
Eric