Gives category Spinner an ID
Without an ID, the default save/restore state mechanism doesn't work, so (for example) if you rotate the screen on ICS, the current category switches back to the default.
This commit is contained in:
parent
42d2070701
commit
0eaca35e5b
4
res/values/ids.xml
Normal file
4
res/values/ids.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item type="id" name="categorySpinner" />
|
||||
</resources>
|
@ -298,6 +298,9 @@ public class FDroid extends TabActivity implements OnItemClickListener,
|
||||
LinearLayout v = new LinearLayout(FDroid.this);
|
||||
v.setOrientation(LinearLayout.VERTICAL);
|
||||
Spinner cats = new Spinner(FDroid.this);
|
||||
// Giving it an ID lets the default save/restore state
|
||||
// functionality do its stuff.
|
||||
cats.setId(R.id.categorySpinner);
|
||||
cats.setAdapter(categories);
|
||||
cats.setOnItemSelectedListener(FDroid.this);
|
||||
v.addView(cats, new LayoutParams(
|
||||
|
Loading…
x
Reference in New Issue
Block a user