diff options
author | Dominik <dominik@dominikschuermann.de> | 2012-06-20 19:28:05 +0300 |
---|---|---|
committer | Dominik <dominik@dominikschuermann.de> | 2012-06-20 19:28:05 +0300 |
commit | 4130123e77c3ca2ea098f7c54dc143051f96b08d (patch) | |
tree | 7bb35890c980d69baa6cfe72c8cfaa4effc97850 /com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java | |
parent | af4d8a59d1fe10226e5c627215863e2b68d4d303 (diff) | |
download | open-keychain-4130123e77c3ca2ea098f7c54dc143051f96b08d.tar.gz open-keychain-4130123e77c3ca2ea098f7c54dc143051f96b08d.tar.bz2 open-keychain-4130123e77c3ca2ea098f7c54dc143051f96b08d.zip |
Log wrapper and actionbarsherlock update
Diffstat (limited to 'com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java')
-rw-r--r-- | com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java b/com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java index f080bfe95..05353d28c 100644 --- a/com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java +++ b/com_actionbarsherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java @@ -81,6 +81,8 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu /** Whether or not the title is stable and can be displayed. */ private boolean mIsTitleReady = false; + /** Whether or not the parent activity has been destroyed. */ + private boolean mIsDestroyed = false; /* Emulate PanelFeatureState */ private boolean mClosingActionMenu; @@ -413,7 +415,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } // Next collapse any expanded action views. - if (aActionBar != null && wActionBar.hasExpandedActionView()) { + if (wActionBar != null && wActionBar.hasExpandedActionView()) { if (action == KeyEvent.ACTION_UP) { wActionBar.collapseActionView(); } @@ -428,7 +430,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu mMenuKeyIsLongPress = true; } else if (event.getAction() == KeyEvent.ACTION_UP) { if (!mMenuKeyIsLongPress) { - if (mActionMode == null) { + if (mActionMode == null && wActionBar != null) { if (wActionBar.isOverflowMenuShowing()) { wActionBar.hideOverflowMenu(); } else { @@ -445,6 +447,11 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu return result; } + @Override + public void dispatchDestroy() { + mIsDestroyed = true; + } + /////////////////////////////////////////////////////////////////////////// // Menu callback lifecycle and creation @@ -977,7 +984,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void run() { //Invalidate if the panel menu hasn't been created before this. - if (!mActivity.isFinishing() && mMenu == null) { + if (!mIsDestroyed && !mActivity.isFinishing() && mMenu == null) { dispatchInvalidateOptionsMenu(); } } |