-3

I'm making a 4.0+ app, using the native actionbar.

How can I change the icon used for the up button (the arrow icon)? Ideally I could do this programatically.

Thanks

user3203425
  • 2,919
  • 4
  • 29
  • 48
  • Programmatically, I don't know, but you can certainly do it with a custom theme, see http://stackoverflow.com/questions/9252354/how-to-customize-the-back-button-on-actionbar – matiash May 29 '14 at 15:33
  • Yeah looks like there's a method for it in ActionBar, but only from api 18 onwards sadly. – user3203425 May 29 '14 at 16:19

1 Answers1

0

for example:

Button btn = new Button(this);
btn.setText("New Todo");
btn.setBackgroundResource(R.drawable.new_todo_image);

or an existing object

btn = (Button) findViewById(R.id.image);
btn.setBackgroundResource(R.drawable.new_todo_image);

The Actionbar logo

final android.app.ActionBar bar = getActionBar();
bar.setIcon(R.drawable.icon); 
Bmuller
  • 239
  • 1
  • 8