Android Question how to call looper prepare?

dreamworld

Active Member
Licensed User
Longtime User
Java.Lang.indexoutofboundsexception: index 23
...
Java.Lang.runtimeexception: can't create handler inside thread that has not called looper.prepare()
 

DennisW

Member
Licensed User
Longtime User
Hi,

I have got the same Error Message by using Thread Libary....

B4X:
Dim myThread As Thread
Dim Lock1 As Lock
....
Sub Activity_Create()
If myThread.IsInitialized =False Then
myThread.Initialise("myThread")
End If
End Sub
...

myThread.Name = "BackThread1"
Dim args(0) As Object
Lock1.Initialize(True)
myThread.Start(Null, "SavePhone", args)

Sometimes it works, sometimes it escapes with the error message from above....

Seams to be in the Thread Libary 1.1....

StackOverflow means that you cant open a Background Thread from a Background Thread....

It always comes with AsyncTask<>

Could someone take a look at this libary?

Thanks in advance

regards

Dennis
 
Upvote 0
Top