Tag Archives: onCreateOptionsMenu

Dynamically Adding, Removing, Toggling and Removing all ActionBar Tabs in Android – Part 2?

By | October 8, 2012

Hi all.. In today’s post I will show you how to add actionbar tabs dynamically, remove one by one , hide and unhide them, removing all tabs at once etc. This simple java code does that. First create a project and in the MainActivity, paste this. [java] package com.coderzheaven.actionbartabs; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import… Read More »

How to start with ActionBar in Android?

By | August 23, 2012

With Android 3.0 Google eliminated the need of hardware menu button which is replaced by Action Bars. Here is a quick example on how to use ActionBars. First create a new project and name it ActionBarExample. Now create a folder named “menu” in res folder and create a new XML file inside it named “action_bar_menu.xml”. action_bar_menu.xml [xml] <?xml… Read More »

How to create OptionsMenu in ANDROID?, a simple example……

By | March 16, 2011

This is a simple example of creating options Menu in ANDROID. This menu can be seen by clicking on the “Menu Button” in ANDROID. Check out this example. [java] package com.options; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; public class myMenu extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public boolean… Read More »