Вопрос

I'm confused because the action bar in my app is only showing the nav drawer icon if I use a device with Android 4.4, but it shows a "back" arrow on my friends' devices with 4.3, 2.3 etc.

I have tried many different combinations of themes and code in my main activity. The only way to show the nav drawer icon is to enable my app icon in action bar, but that's not what I want.

When I hide the APP ICON, the nav drawer icon turns into a back arrow.

Any advice?

I'm using Android Studio, my app supports 2.3+ and I use AppCompat.

Это было полезно?

Решение

I decided to use another icon in my Action Bar and now the navigation drawer icon is visible on all devices.

I added this to my action bar theme in "styles-v14":

<item name="android:displayOptions">homeAsUp|showTitle|showHome</item>
<item name="android:icon">@drawable/ic_custom</item>

And this to my action bar theme in "styles":

<item name="displayOptions">homeAsUp|showTitle|showHome</item>
<item name="icon">@drawable/ic_custom</item>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top