Boş bir nesne referansı yöntemin 'int android.graphics.Bitmap.getWidth ()'

oy
0

Öğrenciyim. Benim ev ödevi için bir çözüm gerekir. Bana yardım eder misiniz? Ben Görüntü Seçimi böyle bir hata alıyorum.

Bazı resimler Böyle hatası alıyorum. uygulama kendini kapanıyor. İstediğin kodlarını gönderebilirsiniz. Nasıl nasıl çözmek bana söyleyebilir? Bir kod olarak buna ihtiyacım var. Ben saatlerce çözemedim.

Burada dosyayı Download edebilir 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) 
Oluştur 19/03/2020 saat 21:57
kaynak kullanıcı
Diğer dillerde...                            

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