android - Migration from SherlockActionBar to ActionBar -
this question has reply here:
actionbar not shown appcompat 3 answersi migrate native actionbar, before, abs working great. now, don't need anymore compatibility develop api 16+
i changed references, , now, menu shows in text, physic button, doesn't show in action bar...
i don't know missing...
here code :
main.xml
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/menu_sync" android:icon="@drawable/ic_action_update" android:orderincategory="80" android:showasaction="ifroom" android:title="sync"/> <item android:id="@+id/more" android:icon="@drawable/ic_action_core_overflow" android:orderincategory="90" android:showasaction="always" android:title="see more options"> <menu> <item android:id="@+id/menu_send_coords" android:icon="@drawable/ic_action_send_coords" android:orderincategory="80" android:showasaction="ifroom" android:title="send coords" android:visible="true"/> <item android:id="@+id/menu_foto" android:icon="@drawable/ic_action_device_access_camera" android:orderincategory="100" android:showasaction="ifroom" android:title="foto" android:visible="true"/> </menu> </item>
in activity :
public class dashboard extends baseactivity { //baseactivity extends actionbaractivity ... @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu items utilize in action bar menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.main, menu); homecoming super.oncreateoptionsmenu(menu); }
i tried alter menu xml 1 ( google example), did not work.
i made search fro reference sherlock* , replace of them
in manifest have :
<application ... android:theme="@style/theme.appcompat" >
in style.xml have :
<style name="appbasetheme" parent="@style/theme.appcompat.light.darkactionbar"> <!-- nil api level dependent yet --> </style> <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <!-- customizations not specific particular api-level can go here. --> </style>
i've followed each step of : http://www.grokkingandroid.com/migrating-actionbarsherlock-actionbarcompat/
what mutual issues when migrating actionbarsherlock actionbarcompat?
actionbarcompat menu item not showing
i don't know more can do??? help appreciated !
i think should alter style.xml , android theme since don't ne android appcompat libarary anymore.
styles.xml:
<style name="appbasetheme" parent="@style/theme.holo.light.darkactionbar"> <!-- nil api level dependent yet --> </style> <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <!-- customizations not specific particular api-level can go here. --> </style>
androidmanifest.xml:
<application android:theme="@style/apptheme" ...
android android-actionbar actionbarsherlock android-actionbar-compat
No comments:
Post a Comment