Please help im getting java.lang.NullPointerException
in android.support.v7.app.ActionBarImplICS.getThemedContext in Google play developer console but when I test it I don't get any errors or crashes , please tell me what is causing the crash and how to solve the problem. the error is shown below, I can also share the code if needed.
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)
This solved my problem from https://stackoverflow.com/a/19320065/619673
I added this code for my activity because I was using theme "NO TITLE" for Activity.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ( keyCode == KeyEvent.KEYCODE_MENU ) {
// do nothing
return true;
}
return super.onKeyDown(keyCode, event);
}
public class MainActivity extends ActionBarActivity
Change this to:
public class MainActivity extends Activity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With