mirror of https://github.com/beemdevelopment/Aegis
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.4 KiB
Java
40 lines
1.4 KiB
Java
7 years ago
|
package com.beemdevelopment.aegis.ui;
|
||
9 years ago
|
|
||
|
import android.os.Bundle;
|
||
|
|
||
7 years ago
|
public class PreferencesActivity extends AegisActivity {
|
||
7 years ago
|
private PreferencesFragment _fragment;
|
||
|
|
||
9 years ago
|
@Override
|
||
8 years ago
|
protected void onCreate(Bundle savedInstanceState) {
|
||
9 years ago
|
super.onCreate(savedInstanceState);
|
||
8 years ago
|
|
||
7 years ago
|
_fragment = new PreferencesFragment();
|
||
|
_fragment.setArguments(getIntent().getExtras());
|
||
7 years ago
|
getSupportFragmentManager().beginTransaction().replace(android.R.id.content, _fragment).commit();
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
@Override
|
||
|
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||
|
// pass permission request results to the fragment
|
||
|
_fragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||
|
}
|
||
7 years ago
|
|
||
|
@Override
|
||
7 years ago
|
protected void onRestoreInstanceState(final Bundle inState) {
|
||
7 years ago
|
// pass the stored result intent back to the fragment
|
||
|
if (inState.containsKey("result")) {
|
||
|
_fragment.setResult(inState.getParcelable("result"));
|
||
|
}
|
||
|
super.onRestoreInstanceState(inState);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
7 years ago
|
protected void onSaveInstanceState(final Bundle outState) {
|
||
7 years ago
|
// save the result intent of the fragment
|
||
|
// this is done so we don't lose anything if the fragment calls recreate on this activity
|
||
|
outState.putParcelable("result", _fragment.getResult());
|
||
|
super.onSaveInstanceState(outState);
|
||
|
}
|
||
9 years ago
|
}
|