无效选项菜单时堆栈溢出

时间:2014-08-19 19:02:20

标签: android stack-overflow

我收到了用户的崩溃报告。我有一个奇怪的问题。无效选项菜单上的堆栈溢出。

看起来invalidateOptionsMenu是一个包装方法,它进行递归调用。我不知道如何处理它。

以下是我的用户的崩溃报告:

USER_COMMENT=null   
ANDROID_VERSION=4.1.2   
APP_VERSION_NAME=1.0  
BRAND=samsung   
PHONE_MODEL=GT-I9100

STACK_TRACE=java.lang.StackOverflowError  at android.content.res.Resources.getValue(Resources.java:1022)  at android.content.res.Resources.loadXmlResourceParser(Resources.java:2131) at android.content.res.Resources.getLayout(Resources.java:865)  at android.support.v7.internal.view.SupportMenuInflater.inflate(SupportMenuInflater.java:115) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:309) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690)  at android.support.v4.app.ActivityCompatHoneycomb.invalidateOptionsMenu(ActivityCompatHoneycomb.java:29) at android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu(FragmentActivity.java:649) at android.support.v7.app.ActionBarActivity.supportInvalidateOptionsMenu(ActionBarActivity.java:171) at com.geniboys.sosyaaal.ExplorerActivity.onCreateOptionsMenu(ExplorerActivity.java:310) at android.app.Activity.onCreatePanelMenu(Activity.java:2571)  at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:225) at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:233) at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:146) at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:200) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:293) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:455) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:829) at android.app.Activity.invalidateOptionsMenu(Activity.java:2690) .....

就像那样

编辑:这是溢出的代码部分。

public boolean onCreateOptionsMenu( Menu menu) {
    getMenuInflater().inflate(R.menu.explorer, menu);
    supportInvalidateOptionsMenu();       

    mMenü = menu;
    return true;
}

1 个答案:

答案 0 :(得分:3)

不要从onCreateOptionsMenu调用invalidateOptionsMenu()它似乎导致递归......

也在这里分享代码