replace mocky settings with working logout
This commit is contained in:
parent
0c637a9686
commit
1dfbe193fa
1 changed files with 7 additions and 1 deletions
|
|
@ -74,9 +74,15 @@ public class MainActivity extends AppCompatActivity implements AsyncTaskCallback
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true;
|
SharedPreferences sharedPref = getSharedPreferences("persistence", MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sharedPref.edit();
|
||||||
|
editor.remove("loginkey");
|
||||||
|
editor.apply();
|
||||||
|
Intent intent = new Intent(this, LoginActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue