6

In my android application,

I am using default theme Theme.Holo.Light.

Now I want to change the "<" sign which is default using this :

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

By changing this into

 <item name="homeAsUpIndicator">@drawable/ic_launcher</item>

But here sign remains as it is,It doesn't change image.I am attaching screen shot of actionBar. Any help will be appreciated.

enter image description here

mmBs
  • 8,421
  • 6
  • 38
  • 46
Ponting
  • 2,248
  • 8
  • 33
  • 61
  • This might help: http://stackoverflow.com/questions/13168843/actionbarsherlock-changing-homeasupindicator-doesnt-work – Tim Malseed Feb 17 '14 at 04:52

1 Answers1

9

Put these in your default Activitytheme.

<item name="android:homeAsUpIndicator">@drawable/ic_launcher</item>
Mihir
  • 2,064
  • 2
  • 21
  • 28
  • You mean in themes.xml file ? Because I am using Default theme : Theme.Holo.Light – Ponting Aug 24 '13 at 10:30
  • Make your custom theme with `Theme.Holo.Light` as its parent. `` – Mihir Aug 24 '13 at 10:31
  • So I make custom theme like this : in style.xml file ? Thanks. – Ponting Aug 24 '13 at 10:33
  • Yes,It works but Image size is so big ..It covers lot of space in actionBar.How can I decrease image size ? – Ponting Aug 24 '13 at 10:41
  • 2
    put image in `drawable-xhdpi` folder and remove it from its previous folder. – Mihir Aug 24 '13 at 10:42
  • That works perfect..Now I want to remove logo of theme.because it looks like this : http://postimg.org/image/ha7je9y3x/ .If I remove logo from manifest file then it displays default android photo.How can i remove this logo ? Thanks. – Ponting Aug 24 '13 at 10:52
  • `Actionbar ab = getActionBar(); ab.setDisplayUseLogoEnabled(false);` – Mihir Aug 24 '13 at 10:55
  • I am using this : ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true);So when I add line end of this then it does not change. actionBar.setDisplayUseLogoEnabled(false); – Ponting Aug 24 '13 at 11:01
  • If its working that's fine or use this `getSupportActionBar().setIcon(android.R.color.transparent);` – Mihir Aug 24 '13 at 11:04
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/36154/discussion-between-ponting-and-mihir) – Ponting Aug 24 '13 at 11:04
  • putting image in drawable-xhdpi does reduce size of image, but but it still covers wide width. How can i eliminate this? – sabbir Dec 24 '14 at 20:49
  • i've put it in the main theme inside theme.xml and is not working! – G. Ciardini Oct 19 '20 at 13:22