java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloworld/com.example.helloworld.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference

tianmaying.com | 3 months ago
  1. 0

    android运行错误找不到原因 | 天码营 - 新一代技术学习服务平台

    tianmaying.com | 3 months ago
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloworld/com.example.helloworld.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
  2. 0

    Android: Getting a null value when assigning Button id | Ask Jon Skeet

    askjonskeet.com | 9 months ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
  3. 0

    Android: Getting a null value when assigning Button id

    Stack Overflow | 2 years ago | Kinoscorpia
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Socket EACCESS permission denied with Android Studio

    Stack Overflow | 2 years ago | Rui Ruivo
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
  6. 0

    App stops working when button is clicked

    Stack Overflow | 2 years ago | Mike12345
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference

  1. ivotje50 3 times, last 3 months ago
  2. brunosatriani 1 times, last 5 months ago
  3. shameer 1 times, last 9 months ago
3 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 'android.view.View android.view.Window.findViewById(int)' on a null object reference

    at android.app.Activity.findViewById()
  2. Android Platform
    Activity.findViewById
    1. android.app.Activity.findViewById(Activity.java:2071)
    1 frame
  3. com.example.helloworld
    MainActivity.<init>
    1. com.example.helloworld.MainActivity.<init>(MainActivity.java:16)
    1 frame
  4. Java RT
    Class.newInstance
    1. java.lang.reflect.Constructor.newInstance(Native Method)
    2. java.lang.Class.newInstance(Class.java:1572)
    2 frames
  5. Android Platform
    ActivityThread.main
    1. android.app.Instrumentation.newActivity(Instrumentation.java:1065)
    2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
    3. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
    4. android.app.ActivityThread.access$800(ActivityThread.java:144)
    5. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
    6. android.os.Handler.dispatchMessage(Handler.java:102)
    7. android.os.Looper.loop(Looper.java:135)
    8. android.app.ActivityThread.main(ActivityThread.java:5221)
    8 frames
  6. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  7. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    2 frames