Action Bar

Action Bar

The project describes How to implement Action Bar for your application. The Action Bar is a widget for activities that replaces the traditional title bar at the top of the screen. By default, the Action Bar includes the application logo on the left side, followed by the activity title, and any available items from the Options Menu on the right side.

Underlying Algorithm:

Basic description of algorithm in step by step form:

1.) Create a Project ActionBarExample
2.) Create and open the res/layout/main.xml file and insert the following:




3.) Make sure to add following in your manifest file:




“android:theme=”@android:style/Theme.NoTitleBar” will enable application to popup as action bar.

4.) Run the application.

Steps to Create:

1.) Open Eclipse. Use the New Project Wizard and select Android Project Give the respective project name i.e. ActionBarExample Enter following information:
Project name: ActionBarExample
Build Target: Android 2.3.3
Application name: ActionBarExample
Package name: org.example. ActionBarExample
Create Activity: ActionBarExample

On Clicking Finish ActionBarExample code structure is generated with the necessary Android Packages being imported along with Following code must be added in ActionBarExample class to get the menu to work.




Output –The final output:

Comments 4

Leave a Reply

Your email address will not be published. Required fields are marked *