java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference

Stack Overflow | HourGlass | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    view.getDrawingCache() returns null only in Samsung Galaxy note 8.0?

    Stack Overflow | 8 months ago | HourGlass
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
  2. 0

    An error occured while executing doInBackground() only with onCreate

    Stack Overflow | 3 months ago | miss C
    java.lang.RuntimeException: An error occured while executing doInBackground()
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Why 'int android.graphics.Bitmap.getWidth()' on a null object reference is flagged?

    Stack Overflow | 2 weeks ago | Cp Karthik
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
  5. 0

    TransformationUtils.rotateImageExif may cause NullPointerException

    GitHub | 2 years ago | b22n
    java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Bitmap$Config.nativeInt' on a null object reference
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 'int android.graphics.Bitmap.getWidth()' on a null object reference

    at android.graphics.Bitmap.createBitmap()
  2. Android Platform
    Bitmap.createBitmap
    1. android.graphics.Bitmap.createBitmap(Bitmap.java:614)
    1 frame
  3. in.com.hourglass
    DrawingActivity$ToolIconClick.onClick
    1. in.com.hourglass.views.DrawView.getCorrectedBitmapWithoutResizing(DrawView.java:449)
    2. in.com.hourglass.activities.DrawingActivity.saveAnswerSheet(DrawingActivity.java:842)
    3. in.com.hourglass.activities.DrawingActivity.navigateNext(DrawingActivity.java:426)
    4. in.com.hourglass.activities.DrawingActivity.access$500(DrawingActivity.java:89)
    5. in.com.hourglass.activities.DrawingActivity$ToolIconClick.onClick(DrawingActivity.java:362)
    5 frames
  4. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:4789)
    2. android.view.View$PerformClick.run(View.java:19881)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:135)
    6. android.app.ActivityThread.main(ActivityThread.java:5294)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
    2 frames