Android Question Threading problem

mirekk36

Member
Licensed User
Longtime User
Hi all,

I'm using threads, and normal way it's work ok .... but sometimes there is strange effect .... For example in my last appliucation I have such error:

An error has occurred in sub:main_btnfile_click (java line898)
java.lang.RuntimeException: Thread.Start : Sub readintelhex not found!
Continue?

why ? Sub readintelhex exists

B4X:
Sub readIntelHex As Boolean
' some code
End Sub

and many times it's working without any problems. But sometimes I become such ERROR ...

I allways start thread like here:

B4X:
Sub Process_Globals
    Dim PT As Thread
End Sub

' in ActivityCreate
PT.Initialise("ProcessThread")

'some button click event
PT.Start(  Me, "readIntelHex", Null )

What can it be ?
 
Last edited:

mirekk36

Member
Licensed User
Longtime User
Erel maybe it's some error in B4A .... I have done small investigation and I see now when exactly I have this error/problem

So if I compile applicaction as any Debug or Release profile - it's working perfectly

but when I will put application into google Play I compile it as Release (obfucated) profile .... and! ... there it's problem in my application. Now any thread will not work :( Of course if I recompile it back as Release it is working OK

Or maybe I do something wrong ?
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
You should place an underscore "_" in your sub-name so that it won't be scrambled by the obfuscator. Rename it to
B4X:
Sub read_Intel_Hex

End Sub
or something.
 
Upvote 0
Top