I get this output when running my app on my J5. Don't know what 2 do plz help
E/AndroidRuntime: FATAL EXCEPTION:
Process: com.example.android.testapp, PID:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.testapp/com.example.android.testapp.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2555)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
at android.app.ActivityThread.access$900(ActivityThread.java:
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
at android.os.Handler.dispatchMessage(Handler.java:
at android.os.Looper.loop(Looper.java:
at android.app.ActivityThread.main(ActivityThread.java:
at java.lang.reflect.Method.invoke(Native
at java.lang.reflect.Method.invoke(Method.java:
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object
at android.app.Activity.findViewById(Activity.java:
at com.example.android.testapp.MainActivity.<init>(MainActivity.java:
at java.lang.reflect.Constructor.newInstance(Native
at java.lang.Class.newInstance(Class.java:
at android.app.Instrumentation.newActivity(Instrumentation.java:
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
at android.app.ActivityThread.access$900(ActivityThread.java:
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
at android.os.Handler.dispatchMessage(Handler.java:
at android.os.Looper.loop(Looper.java:
at android.app.ActivityThread.main(ActivityThread.java:
at java.lang.reflect.Method.invoke(Native
at java.lang.reflect.Method.invoke(Method.java:
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
I've looked at blogs, youtube videos and here, in StackOverflow, but I don't know how to solve this.