문제

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.

도움이 되었습니까?

해결책

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);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top