methode "int android.graphics.Bitmap.getWidth () op een nul objectverwijzing

stemmen
0

Ik ben een student. Ik heb een oplossing voor mijn huiswerk. Kunt u mij helpen? Ik krijg een dergelijke fout in Image Selection.

Sommige foto's die ik krijg dergelijke fout. De applicatie zelf is gesloten. Ik kan de codes die u wilt verzenden. Hoe kunt u mij vertellen hoe het op te lossen? Ik heb het als een code. Ik kon er niet uit voor uren.

U kunt hier het bestand https://www.detectivestudio.com/UploadActivity.zip

 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: andoridsticker.allnational, PID: 15406
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1578, result=-1, data=Intent { (has extras) }} to activity {andoridsticker.allnational/com.virmana.stickers_app.ui.UploadActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5078)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5120)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
        at android.os.Handler.dispatchMessage(Handler.java:112)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
        at com.virmana.stickers_app.ui.UploadActivity.getFileFromBitmap(UploadActivity.java:925)
        at com.virmana.stickers_app.ui.UploadActivity.onActivityResult(UploadActivity.java:432)
        at android.app.Activity.dispatchActivityResult(Activity.java:7797)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5071)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5120) 
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) 
        at 
I'm a student. I need a solution for my homework. Can you help me?
I get such an error in Image Selection.

android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) 
        at android.os.Handler.dispatchMessage(Handler.java:112) 
        at android.os.Looper.loop(Looper.java:216) 
        at android.app.ActivityThread.main(ActivityThread.java:7625) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) 
De vraag is gesteld op 19/03/2020 om 21:57
bron van user
In andere talen...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more