You can add an arrow by writing your own ActionBar style that will be used with your application theme.
res / values-v11 / styles.xml: (or add them to existing .xml styles)
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="MyTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar"> <item name="android:displayOptions">showHome|homeAsUp|showTitle</item> </style> </resources>
Then apply this theme in your AndroidManifest.xml:
<application android:theme="@style/MyTheme">
Note. The obvious way to add this arrow is to call:
getActionBar().setDisplayHomeAsUpEnabled(true);
after loading the second screen, but I think there is an Android error there, where getActionBar () always returns the first-level ActionBar object, and not the one that is currently visible, so the installation of the dynamic error fails.
liucheia Apr 27 '13 at 0:37 2013-04-27 00:37
source share