Bug? IllegalStateException

Filippo

Expert
Licensed User

Attachments

Last edited:

Filippo

Expert
Licensed User

Filippo

Expert
Licensed User
Try to use CallSubDelayed to call a sub that will show the msgbox.
Have already tried, unfortunately without success.
 

Filippo

Expert
Licensed User
Nexus 7(2012) , android 5.1 -> KO :mad:
Nexus 7(2013) , android 5.1 -> OK :)

Samsung-S4, android 5.01 -> OK :)
HTC-Desire, android 2.3.3 -> OK :)
Medion-Lifetab, android 4.4.2 -> OK :)
 

Filippo

Expert
Licensed User
I have my complete project sent to you.
I thank you already in advance.
 

Filippo

Expert
Licensed User
I didn't see your previous post before sending you the email.

First add a Try / Catch block before this call to prevent the app from crashing (you can show a toast message if there is an error).


Does it happen if you remove the bitmap from the msgbox2 call?
I have already tried everything.
When I use the "try / catch block" is no mistake.

When I use instead of Msgbox a ToastMessageShow then comes no error.
 
Last edited:

Filippo

Expert
Licensed User
When I create the Msgbox with a homemade Msgbox with Panel + label + button then everything works without problems.
 

Filippo

Expert
Licensed User
Is there a chance to find the error?
I do not think I'm the only one with this problem.
The same problem also comes with Customdialog2.

I tried the Library BetterDialogs, unfortunately is the same error.
 

Filippo

Expert
Licensed User
I will track this issue. I also tried to reproduce it in a small project unsuccessfully which makes it difficult to debug it.
As it is on your Nexus 5? Did you reproduce the error?

I hope you find this issue. :)
But that would be otherwise the first time that you can not solve a problem.;)
 

Filippo

Expert
Licensed User
There was no error on the Nexus 5.
Then it's just a Nexus-7 error?
I have the error on my Nexus-7 and a customer on his Nexus-7.
 

Filippo

Expert
Licensed User
I have found something new.
When I run the Sub "mnuInfo_Click" from Sub "btnTest_Click" then no error occurs.
That is, the error is thrown when executing the Sub "mnuInfo_Click" from the menu.

B4X:
  Activity.AddMenuItem2("Info", "mnuInfo", LoadBitmap(File.DirAssets,"btn_info.png"))
...
Sub btnTest_Click
    mnuInfo_Click
End Sub

Sub mnuInfo_Click
   Msgbox2("Version " & mBBL.getVersion & CRLF & CRLF & Copyright & CRLF & Autor, AppName,"OK","","",LoadBitmap(File.DirAssets,"cronomillemiglia_48x48.png"))
End Sub
 

Filippo

Expert
Licensed User
OK, I've found the solution! :)
B4X:
Sub ShowInfo
    Msgbox2("Version " & mBBL.getVersion & CRLF & CRLF & Copyright & CRLF & Autor, AppName,"OK","","",LoadBitmap(File.DirAssets,"cronomillemiglia_48x48.png"))
End Sub

Sub mnuInfo_Click
    CallSubDelayed(Me, "ShowInfo")
    Return
End Sub
 

Filippo

Expert
Licensed User
See my answer in post #4 ;)
I had already tried it with "CallSubDelayed", but unfortunately no "Return" and that had not worked.
So is OK :)
B4X:
Sub mnuInfo_Click
    CallSubDelayed(Me, "ShowInfo")
    Return
End Sub
and so is not OK :(
B4X:
Sub mnuInfo_Click
    CallSubDelayed(Me, "ShowInfo")
End Sub
 
Top