java.lang.RuntimeException

Unable to start activity ComponentInfo{ceg.dev.cegscms/ceg.dev.cegscms.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

Samebug tips0

There are no available Samebug tips.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web158

  • via Stack Overflow by Abhi
    ,
  • Stack trace

    • java.lang.RuntimeException: Unable to start activity ComponentInfo{ceg.dev.cegscms/ceg.dev.cegscms.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at android.content.ContextWrapper.getResources(ContextWrapper.java:86) at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:74) at android.support.v7.app.AppCompatActivity.getResources(AppCompatActivity.java:541) at android.view.Window.getDefaultFeatures(Window.java:1306) at android.view.Window.<init>(Window.java:453) at com.android.internal.policy.impl.PhoneWindow.<init>(PhoneWindow.java:290) at com.android.internal.policy.impl.Policy.makeNewWindow(Policy.java:60) at com.android.internal.policy.PolicyManager.makeNewWindow(PolicyManager.java:57) at android.app.Activity.attach(Activity.java:5932) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Indri YunitaIndri Yunita
    5 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    balajivaishnavbalajivaishnav
    2 times, last one,
    4 more bugmates