Skip to content
This repository was archived by the owner on Mar 17, 2023. It is now read-only.

generatorBit() add Exception handling#109

Open
Kim-DongGeun wants to merge 3 commits intoiamutkarshtiwari:masterfrom
Kim-DongGeun:master
Open

generatorBit() add Exception handling#109
Kim-DongGeun wants to merge 3 commits intoiamutkarshtiwari:masterfrom
Kim-DongGeun:master

Conversation

@Kim-DongGeun
Copy link

hi i faced exception because getMeasuredWidth() return 0
so i add some code to handle this exception

this is crash log i faced

Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
       at android.graphics.Bitmap.createBitmap(Bitmap.java:1102)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:1069)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:1019)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:980)
       at iamutkarshtiwari.github.io.ananas.editimage.view.CustomPaintView.generatorBit(CustomPaintView.java:60)
       at iamutkarshtiwari.github.io.ananas.editimage.view.CustomPaintView.reset(CustomPaintView.java:158)
       at iamutkarshtiwari.github.io.ananas.editimage.fragment.paint.PaintFragment.backToMain(PaintFragment.java:157)
       at iamutkarshtiwari.github.io.ananas.editimage.fragment.paint.PaintFragment.onClick(PaintFragment.java:116)
       at android.view.View.performClick(View.java:7792)
       at android.view.View.performClickInternal(View.java:7769)
       at android.view.View.access$3800(View.java:910)
       at android.view.View$PerformClick.run(View.java:30213)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8663)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant