Ganesh Katikar
Ganesh Katikar

Reputation: 2700

How to do stuff with actionbar sherlock icon on top of left side?

enter image description here

I want to implement on click listener on icon of sherlock actionbar show in above image. How can I do this? Please anyone can give this answer.

Upvotes: 0

Views: 41

Answers (1)

r2DoesInc
r2DoesInc

Reputation: 3771

In your activity,

in your onCreate()

getActionBar().setDisplayHomeAsUpEnabled(true);

and then

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        //do your stuff here
    }
    return super.onOptionsItemSelected(item);
}

Upvotes: 1

Related Questions