ActionBar ab = This.getactionbar ();
Ab.setdisplayhomeasupenabled (TRUE);
The thing to note here is that if the minimum version of your manifest file is less than 3.0 error, you must have a version greater than 3.0
The first thing to do is create a Actionbar
Then add the Actionbar click Method to the Activity
public boolean onmenuitemselected (int featureid, MenuItem item) {
TODO auto-generated Method Stub
Switch (Item.getitemid ()) {
Case Android. R.ID.HOME://the default ID value and then closes the current activity to
Finish ();
Break
Case R.id.addpeople:
Intent Intent = new Intent (Mylinkmanactivity.this,
Addlinkmanactivity.class);
StartActivity (Intent);
Break
}
Return super.onmenuitemselected (Featureid, item);
}
Each activity has a menu, and we want to insert the function into bar via the XML file inside.
In summary, some of the usual functions will be put in the Actionbar.
Simple application of Actionbar