Fremgangsmåten 'int android.graphics.Bitmap.getWidth ()' på en null objekt referanse

stemmer
0

Jeg er en student. Jeg trenger en løsning for leksene mine. Kan du hjelpe meg? Jeg får en slik feil i bildevalg.

Noen bilder jeg få en slik feil. Søknaden avsluttes selv. Jeg kan sende kodene du ønsker. Hvordan kan du fortelle meg hvordan jeg skal løse det? Jeg trenger det som en kode. Jeg kunne ikke finne ut av det i timevis.

Du kan laste ned her filen 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) 
Publisert på 19/03/2020 klokken 21:57
kilden bruker
På andre språk...                            

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