Verfahren ‚int android.graphics.Bitmap.getWidth ()‘ auf einem Objektreferenz null

stimmen
0

Ich bin Student. Ich brauche eine Lösung für meine Hausaufgaben. Kannst du mir helfen? Ich erhalte einen solchen Fehler in Bildauswahl.

Einige Bilder, die ich solche Fehler. Die Anwendung schließt sich. Ich kann die Codes senden Sie wollen. Wie können Sie mir sagen, wie es zu lösen? Ich brauche es als Code. Ich konnte es nicht stundenlang herauszufinden.

Hier können Sie die Datei herunterladen in 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) 
Veröffentlicht am 19/03/2020 um 21:57
quelle vom benutzer
In anderen Sprachen...                            

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