Fix bug 5174277 - Trouble with Menus
Make sure that options menu panel presenters associated with a PhoneWindow
get re-wired properly when a new menu is generated.
Change-Id: Ic06130019aec8b8edc372054c348f147d164fc5f
diff --git a/core/java/com/android/internal/view/menu/ListMenuPresenter.java b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
index 146c7ac..e6538b0 100644
--- a/core/java/com/android/internal/view/menu/ListMenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
@@ -34,6 +34,8 @@
* MenuPresenter for list-style menus.
*/
public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClickListener {
+ private static final String TAG = "ListMenuPresenter";
+
Context mContext;
LayoutInflater mInflater;
MenuBuilder mMenu;
@@ -76,7 +78,7 @@
public void initForMenu(Context context, MenuBuilder menu) {
if (mThemeRes != 0) {
mContext = new ContextThemeWrapper(context, mThemeRes);
- } else if (mContext == null) {
+ } else if (mContext != null) {
mContext = context;
}
mInflater = LayoutInflater.from(mContext);