how to solve issues between actiobar and toolbar in android in different versions of android -
i finished project .but runs on lollipop , marshmallow.it not runs in kitkat , older versions due action bar , toolbar prblm.if adjust theme ,some times shows me 2 action bars on top.i m new android.anybody me finish tis completely.its first project given me.thank ...i m running out of time...i m posting 1 sample activity...
`<activity android:name=".anims.animhome" android:theme="@style/apptheme.noactionbar" />'
my toolbar theme
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorprimary" android:minheight="?android:attr/actionbarsize" app:popuptheme="@style/apptheme" app:theme="@style/themeoverlay.appcompat.dark.actionbar" /> 'public class animhome extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { private progressdialog loaddialog; private jsonarray _myresponse; public actionbar ab; @override protected void oncreate(@nullable bundle savedinstancestate) { requestwindowfeature(window.feature_no_title); super.oncreate(savedinstancestate); setcontentview(r.layout.anim_home); inilizeprogressdialog(); drawerlayout(); } private void drawerlayout() { toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); try { setsupportactionbar(toolbar); } catch (exception e) { e.printstacktrace(); } final drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); actionbardrawertoggle toggle = new actionbardrawertoggle( this, drawer, toolbar, r.string.navigation_drawer_open, r.string.navigation_drawer_close); if (drawer != null) { drawer.adddrawerlistener(toggle); } toggle.syncstate(); navigationview navigationview = (navigationview) findviewbyid(r.id.nav_view); if (navigationview != null) { navigationview.setnavigationitemselectedlistener(this); } }
}'
i rewrite app using api level 8. level 8 goes on 95% of android devices. can check manifest , try set "minisdk 8" "targetsdk 18" , "maxsdk 24". want search manifest looks this
<uses-sdk android:minsdkversion="integer" android:targetsdkversion="integer" android:maxsdkversion="integer" />
Comments
Post a Comment