mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
use home button to return from preferences
This commit is contained in:
parent
19b48565f4
commit
835bbc01dc
@ -78,6 +78,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
System.out.println("Exception caught :(");
|
System.out.println("Exception caught :(");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
this.leftActivity = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.menu_add_password:
|
case R.id.menu_add_password:
|
||||||
@ -91,11 +92,6 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
refreshListAdapter();
|
refreshListAdapter();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
case android.R.id.home:
|
|
||||||
getFragmentManager().popBackStack();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.zeapo.pwdstore;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
public class UserPreference extends PreferenceActivity {
|
public class UserPreference extends PreferenceActivity {
|
||||||
|
|
||||||
@ -12,4 +13,20 @@ public class UserPreference extends PreferenceActivity {
|
|||||||
|
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
switch (id) {
|
||||||
|
case android.R.id.home:
|
||||||
|
setResult(RESULT_OK);
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user