reidisaki
reidisaki

Reputation: 1524

Remove Left arrow from SupportActionbar but keep logo

I am able to do this but I now can not click the logo. It doesn't fire onOptionsItemSelected()..

actionBar= getSupportActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setTitle("");
        actionBar.setLogo(R.drawable.logo);
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayUseLogoEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setHomeButtonEnabled(true);

if i set actionBar.setDisplayHomeAsUpEnabled(true); the arrow shows up. I have found a clone of this question, on SO but no one answered it correctly. Someone suggested using a transparent image for teh arrow but how do I override that?

Upvotes: 0

Views: 101

Answers (1)

Harin
Harin

Reputation: 2423

I got it, use

setHomeAsUpIndicator()

Like this:

ActionBar actionBar = getSupportActionBar();
actionBar.setHomeAsUpIndicator(R.drawable.logo);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);

Upvotes: 1

Related Questions