Sherlock Action Bar: findViewById (android.R.id.home) returns null in android 2.3

I am using the Barlock Bar for my project. But I am facing a problem. I use this code in the OnCreate method.

        ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    View iconImage = findViewById(android.R.id.home);
    iconImage.setPadding(100, 0, 0, 0);

In android 4.1, "iconImage" is not null. But on Android 2.3. iconImage is always zero. You know why? and did you know how I can get the home button in Android 2.3. Note. I checked, I can detect the action of pressing a button on a house by implementing the onOptionsItemSelected method.

Please help me!

+5
source share
1 answer

"You cannot access your home view because it exists above the content view and window design"

ActionBarSherlock

P/s: VNese: D

+3

All Articles