Search code examples
androidandroid-appcompatandroid-actionbaractivity

How to get home view in appcompat.v7


I´m using ActionBarActivity and trying to get the position of the home button (burger) using:

View home = findViewById(android.support.v7.appcompat.R.id.home);

and/or

View home = findViewById(android.R.id.home);

The problem is I always get null. Anyone know how to get the view? Maybe I´m trying to get it from the wrong place

I´m trying to get it from OnCreateOptionsMenu(Menu menu)


Solution

  • I follow the NikolasDespotoski code and I´m able to get it now

    Code here

    Thank you guys