Android Question Msgbox2 Creash

hanyelmehy

Active Member
Licensed User
Longtime User
can old Msgbox2 make crash on some devices
i get this crash report
B4X:
 Fatal Exception: anywheresoftware.b4a.B4AUncaughtException:
       at anywheresoftware.b4a.Msgbox.msgbox(Msgbox.java:189)
       at anywheresoftware.b4a.keywords.Common.Msgbox2(Common.java:452)
       at students.one.onlineexam.examlist._filltable(examlist.java:3560)
       at students.one.onlineexam.examlist$ResumableSub_AdjustLayout.resume(examlist.java:1169)
       at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1748)
       at android.os.Handler.handleCallback(Handler.java:942)
       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:8741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
 

DonManfred

Expert
Licensed User
Longtime User
can old Msgbox2 make crash on some devices
Shows a modal message box with the specified message and title.
It is recommended to use Msgbox2Async instead.
Message - The dialog message.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" to hide the button.
Cancel - The text to show for the "cancel" button. Pass "" to hide the button.
Negative - The text to show for the "negative" button. Pass "" to hide the button.
Icon - A bitmap that will be drawn near the title. Pass Null to hide hide the icon.
Returns one of the DialogResponse values.
 
Upvote 1

Sagenut

Expert
Licensed User
Longtime User
Without an example that show the issue or knowing the flow of your code it's really hard to help you for anyone.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
but this mean i can still use Msgbox2
No, don't use Msgbox or Msgbox2. Msgbox, DoEvents and other synchronous dialogs used a synchronous mechanism designed by Erel in the early days of Android as Android, by design unlike Windows, does not implement synchronous waits while letting the message loop run. Unfortunately over the years the Android message loop handling has become more complex and as a result Erel's synchronous mechanisms is now flaky - hence, Msgbox, DoEvents and all the synchronous dialogs are deprecated but available in case of need for backward compatibility.
 
Upvote 2
Top