java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.codyhunsberger.cis_3515_lab_3/com.example.codyhunsberger.cis_3515_lab_3.CanvasActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' 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 hunsbct
, 1 year ago
Unable to start activity ComponentInfo{com.example.codyhunsberger.cis_3515_lab_3/com.example.codyhunsberger.cis_3515_lab_3.CanvasActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
via GitHub by barbeau
, 1 year ago
Unable to start activity ComponentInfo{com.joulespersecond.seattlebusbot/org.onebusaway.android.ui.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int org.onebusaway.android.ui.AlertList.getCount()' on a null object reference
via Stack Overflow by Ricardo Amaya
, 1 month ago
Unable to start activity ComponentInfo{com.ramaya947yahoo.mymaps/com.ramaya947yahoo.mymaps.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.maps.GoogleMap.getMapType()' on a null object reference
via Stack Overflow by President Camacho
, 1 year ago
Unable to start activity ComponentInfo{benlab.app1ben/benlab.app1ben.game_page}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.Random.nextInt()' on a null object reference
via google.com by Unknown author, 11 months ago
Unable to start activity ComponentInfo{com.alwaysorg.chatfoss/com.codelegs.ao.ui.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference
via Stack Overflow by shyamyy
, 11 months ago
Unable to start activity ComponentInfo{notebookdata.mycalltaxi.notebook/notebookdata.mycalltaxi.notebook.CarSelectActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.codyhunsberger.cis_3515_lab_3/com.example.codyhunsberger.cis_3515_lab_3.CanvasActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at com.example.codyhunsberger.cis_3515_lab_3.CanvasActivity.setBgColor(CanvasActivity.java:31)
at com.example.codyhunsberger.cis_3515_lab_3.CanvasActivity.onCreate(CanvasActivity.java:25)
at android.app.Activity.performCreate(Activity.java:6272)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

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