how to align icon on the left side of the app bar in android -
i trying push icon image on left side of app bar in android icon displaying in middle of app(tool) bar. how align icon on right side of app bar in android? please have @ image below.
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="divine.calcify.activities.homescreenactivity"> <item android:layoutdirection="ltr" android:id="@+id/hs_back_button" android:icon="@mipmap/ic_back" android:title="@string/homescreen_back" app:showasaction="always" ></item> <item android:id="@+id/menu_search" android:icon="@mipmap/ic_search" android:title="@string/homescreen_search" android:orderincategory="1" app:showasaction="always" app:actionviewclass="android.support.v7.widget.searchview"/> <item android:id="@+id/menu_notifications" android:icon="@mipmap/ic_divine_notification" android:title="@string/homescreen_notification" android:orderincategory="2" app:showasaction="always" /> </menu>
pragmatically add button in java file (in activity
)
try this
actionbar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); actionbar.settitle("divine");
Comments
Post a Comment