I'm trying to use ActionBarSherlock in one specific activity which I've declared in the Manifest like this:
<activity
android:name=".activities.Bla"
android:screenOrientation="portrait"
android:theme="@style/Theme.Sherlock" />
My Activity code is this:
public class Bla extends SherlockFragmentActivity implements ActionBar.OnNavigationListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bla);
getSupportActionBar().setTitle("");
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
Context context = getSupportActionBar().getThemedContext();
ArrayAdapter<CharSequence> list =
ArrayAdapter.createFromResource(context, R.array.cartaz_filters, R.layout.actionbar_spinner_item);
list.setDropDownViewResource(R.layout.actionbar_spinner_dropdown_item);
getSupportActionBar().setListNavigationCallbacks(list, this);
}
@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
return true;
}
}
However, every time I run this in an Android 2.1 I get the following error:
E/ResourceType(9672): Style contains key with bad entry: 0x01000000
I think this might be related with this question: Read Newer Theme Attributes On Older Platform but I don't know how to solve it.
Any suggestions? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…