0

I'm using this (jfeinstein10/SlidingMenu) library to implement sliding menu. In this I want to hide the displayhomeasup arrow from actionbar, but its not allowing to do so.

I tried every possible code found on stackoverflow

I've tried this,

actionbar = getSupportActionBar();
actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionbar.setTitle("");
actionbar.setIcon(R.drawable.menu);
actionbar.setDisplayHomeAsUpEnabled(false);
actionbar.setHomeButtonEnabled(true);
actionbar.setDisplayShowCustomEnabled(true);
actionbar.setCustomView(R.layout.actionbar_title);

I also tried to set it in styles, The code for values-v14 is,

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/Widget.AppTheme.ActionBar</item>
    </style>

    <style name="Widget.AppTheme.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">@drawable/actionbar_background</item>
        <item name="android:displayOptions">showHome|useLogo</item>
        <item name="android:homeAsUpIndicator">@null</item>
    </style>

</resources>

In this I also tried,

<item name="android:homeAsUpIndicator">@drawable/blank</item>

But none of these code worked,

And at last this, from here

int upId = Resources.getSystem().getIdentifier("up", "id", "android");
if(upId > 0){
    ImageView upImage = (ImageView)findViewById(upId);
    upImage.setImageResource(R.drawable.blank);
}

This code worked successfully, but problem is It does not guarantee to work in all devices, because here in getIdentifier("up", "id", "android") function "up" keywork may differ menufacture company wise.

I want this thing to work in all devices from api 8 to api 18

Please Help...........

Community
  • 1
  • 1
Krunal Panchal
  • 384
  • 2
  • 3
  • 12
  • Why don't you use both [Android compatibility package](http://developer.android.com/tools/support-library/index.html) with [ActionBar support](http://developer.android.com/guide/topics/ui/actionbar.html) and use from there the [NavDrawer](http://developer.android.com/training/implementing-navigation/nav-drawer.html)? – gunar Nov 01 '13 at 06:19
  • gunar, thanks for your response, but I know these things already, and as per requirement I have to use slidingmenu only – Krunal Panchal Nov 01 '13 at 06:47

0 Answers0