This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String STATE_ID = "id"; | |
private static final String STATE_ITEMS = "items"; | |
private long mId; | |
private ArrayList<Item> mItems; | |
private ListView mListView; | |
private ArrayAdapter<Item> mAdapter; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String STATE_ITEMS = "items"; | |
// Make sure to declare as ArrayList so it's Serializable | |
private ArrayList<Item> mItems; | |
... | |
@Override | |
protected void onSaveInstanceState(Bundle outState) { | |
// Make sure to call the super method so that the states of our views are saved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String STATE_COUNTER = "counter"; | |
private TextView mCounterTextView; | |
private int mCounter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String STATE_COUNTER = "counter"; | |
private int mCounter; | |
... | |
@Override | |
protected void onSaveInstanceState(Bundle outState) { | |
// Make sure to call the super method so that the states of our views are saved | |
super.onSaveInstanceState(outState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".MyActivity" | |
android:label="@string/title_my_activity" | |
android:screenOrientation="portrait" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".MyActivity" | |
android:label="@string/title_my_activity" | |
android:configChanges="orientation|screenSize|keyboardHidden" /> |
NewerOlder