java – android. support. v7. app. ActionBarImplICS. Getthemedcontext NullPointerException in Android
•
Java
Please help me get Java lang.NullPointerException
java.lang.NullPointerException at android.support.v7.app.ActionBarImplICS.getThemedContext(ActionBarImplICS.java:287) at android.support.v7.app.ActionBarImplJB.getThemedContext(ActionBarImplJB.java:20) at android.support.v7.app.ActionBarActivityDelegate.getActionBarThemedContext(ActionBarActivityDelegate.java:207) at android.support.v7.app.ActionBarActivityDelegateICS.onActionModeStarted(ActionBarActivityDelegateICS.java:196) at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onActionModeStarted(ActionBarActivityDelegateICS.java:351) at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2292) at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2215) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:619) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:619) at android.view.View.startActionMode(View.java:4191) at android.webkit.WebViewClassic.startSelectActionMode(WebViewClassic.java:5049) at android.webkit.WebViewClassic.setupWebkitSelect(WebViewClassic.java:5178) at android.webkit.WebViewClassic.updateTextSelectionFromMessage(WebViewClassic.java:7929) at android.webkit.WebViewClassic.access$4300(WebViewClassic.java:147) at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:7249) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)
Solution
This from https://stackoverflow.com/a/19320065/619673 Solved my problem
I added this code to my activity because I used the theme "no title" in the activity
@Override public boolean onKeyDown(int keyCode,KeyEvent event) { if ( keyCode == KeyEvent.KEYCODE_MENU ) { // do nothing return true; } return super.onKeyDown(keyCode,event); }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码