java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.getDecorView()' on a null object reference I don't know what to do. Here is the logcat log java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.george.photoeditor/com.example.gentaliu.photoeditor.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.getDecorView()' on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by G.Al
, 1 year ago
Attempt to invoke virtual method 'android.view.View android.view.Window.getDecorView()' on a null object reference I don't know what to do. Here is the logcat log java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
via Stack Overflow by Hao
, 1 year ago
Attempt to invoke virtual method 'void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference
via Stack Overflow by Matt Brown
, 1 year ago
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by guitarhero23
, 1 month ago
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Sveiny
, 1 year ago
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Bryce Wharton
, 1 year ago
Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.getDecorView()' on a null object reference I don't know what to do. Here is the logcat log java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.george.photoeditor/com.example.gentaliu.photoeditor.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.getDecorView()' on a null object reference
at android.app.Activity.initWindowDecorActionBar(Activity.java:2162)
at android.app.Activity.getActionBar(Activity.java:2122)
at com.example.gentaliu.photoeditor.MainActivity.(MainActivity.java:42)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)

Users with the same issue

Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.