„Int android.graphics.Bitmap.getWidth ()“ metoda pe un obiect de referință nul

voturi
0

Sunt un student. Am nevoie de o soluție pentru temele. Ma poti ajuta? I a lua o astfel de eroare în Selectare Imagine.

Unele imagini I a lua o astfel de eroare. Cererea se închide în sine. Eu pot trimite codurile dorite. Cum poți să-mi spui cum să o rezolve? Am nevoie de ea ca un cod. Nu am putut da seama de ore.

Aveți posibilitatea să descărcați aici fișierul 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) 
Întrebat 19/03/2020 la 21:57
sursa de către utilizator
În alte limbi...                            

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