I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7ddd3c69 authored by str4d's avatar str4d
Browse files

Save and restore selected rate graph

parent 9d965a55
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@ import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
public class GraphActivity extends I2PActivityBase {
private static final String SELECTED_RATE = "selected_rate";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -35,5 +37,17 @@ public class GraphActivity extends I2PActivityBase {
};
actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationListener);
if (savedInstanceState != null) {
int selected = savedInstanceState.getInt(SELECTED_RATE);
actionBar.setSelectedNavigationItem(selected);
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_RATE,
getSupportActionBar().getSelectedNavigationIndex());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment