Pressing the actionbar icon will take you back to the accountsscreen.

This commit is contained in:
Sander Bogaert 2012-07-17 10:59:55 -04:00 committed by Andrew Chen
parent 67b4cd9c8e
commit ee6bd2dc22
4 changed files with 23 additions and 0 deletions

View File

@ -309,6 +309,13 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
context.startActivity(intent);
}
public static void listAccountsClearTop(Context context) {
Intent intent = new Intent(context, Accounts.class);
intent.putExtra(EXTRA_STARTUP, false);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
@Override
public void onNewIntent(Intent intent) {
Uri uri = intent.getData();

View File

@ -556,6 +556,12 @@ public class FolderList extends K9ListActivity implements OnNavigationListener {
@Override public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Accounts.listAccountsClearTop(this);
finish();
return true;
case R.id.compose:
MessageCompose.actionCompose(this, mAccount);

View File

@ -1500,6 +1500,12 @@ public class MessageList
final List<MessageInfoHolder> selection = getSelectionFromCheckboxes();
int itemId = item.getItemId();
switch (itemId) {
case android.R.id.home: {
// app icon in action bar clicked; go home
Accounts.listAccountsClearTop(this);
finish();
return true;
}
case R.id.compose: {
onCompose();
return true;

View File

@ -852,6 +852,10 @@ public class MessageView extends K9Activity implements OnClickListener {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Accounts.listAccountsClearTop(this);
finish();
break;
case R.id.delete:
onDelete();
break;