I got my solution.. I don't whether it is perfect way to do it but it is working instead of using onMenuItemSelected I just used onOptionsItemSelected and my code is working Here is the final code: public class Tabs3 extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super. OnCreate(savedInstanceState); final TabHost tabHost = getTabHost(); tabHost. AddTab(tabHost.
NewTabSpec("tab1"). SetIndicator("list") . SetContent(new Intent(this, List1.
Class))); tabHost. AddTab(tabHost. NewTabSpec("tab2").
SetIndicator("photo list") . SetContent(new Intent(this, List8. Class))); } @Override public boolean onPrepareOptionsMenu(Menu menu) { menu.
RemoveGroup(0); menu. Add(0, 0, 0, "Home"). SetIcon( android.R.drawable.
Ic_menu_preferences); return super. OnPrepareOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 0: setResult(10); finish(); return true; } return super. OnOptionsItemSelected(item); } }.
I got my solution.. I don't whether it is perfect way to do it but it is working.. instead of using onMenuItemSelected , I just used onOptionsItemSelected and my code is working. Here is the final code: public class Tabs3 extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super. OnCreate(savedInstanceState); final TabHost tabHost = getTabHost(); tabHost.
AddTab(tabHost. NewTabSpec("tab1"). SetIndicator("list") .
SetContent(new Intent(this, List1. Class))); tabHost. AddTab(tabHost.
NewTabSpec("tab2"). SetIndicator("photo list") . SetContent(new Intent(this, List8.
Class))); } @Override public boolean onPrepareOptionsMenu(Menu menu) { menu. RemoveGroup(0); menu. Add(0, 0, 0, "Home").
SetIcon( android.R.drawable. Ic_menu_preferences); return super. OnPrepareOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 0: setResult(10); finish(); return true; } return super.
OnOptionsItemSelected(item); } }.
I want to show menu options in an activity which hosts tab views. Here is the code of my tab view activity. Now when I am pressing android menu button, onPrepareOptionsMenu is called which is correct but when I select the menu option, nothing happens.
I have also debugged my code and control is not reaching in onMenuItemSelected.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.