java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference

Stack Overflow | soccerway | 3 months ago
  1. 0

    Would like to implement 'screenshot' function and 'share' option in my Android app, but throwing error

    Stack Overflow | 3 months ago | soccerway
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
  2. 0

    Occurred Exception for Android 6.0, When I use checkSelfPermission

    Stack Overflow | 1 year ago | KYOSEON LEE
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
  3. 0

    checkselfpression crashed the app

    Stack Overflow | 8 months ago | carlosx2
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NullPointerException when trying to check permissions

    Stack Overflow | 7 months ago | B. Bob
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
  6. 0

    Can't ask permission at runtime (Android)

    Stack Overflow | 4 months ago | Stackingcoder
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference

  1. balajivaishnav 3 times, last 9 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference

    at android.content.ContextWrapper.checkPermission()
  2. Android Platform
    ContextWrapper.checkPermission
    1. android.content.ContextWrapper.checkPermission(ContextWrapper.java:637)
    1 frame
  3. Android Support v4
    ContextCompat.checkSelfPermission
    1. android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:387)
    1 frame
  4. com.mycompany.myfirstglapp
    MainActivity.onCreate
    1. com.mycompany.myfirstglapp.GPSTracker.getLocation(GPSTracker.java:133)
    2. com.mycompany.myfirstglapp.GPSTracker.<init>(GPSTracker.java:62)
    3. com.mycompany.myfirstglapp.MainActivity.onCreate(MainActivity.java:102)
    3 frames
  5. Android Platform
    ActivityThread.handleLaunchActivity
    1. android.app.Activity.performCreate(Activity.java:6237)
    2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    4 frames