Hi Everyone,
I've a problem with LogCat event.
I start the logcat using
then in the objLog_LogCatData I would catch the logdata
But when i start LogCatStart, I get the following error
Ignoring event: objlog_logcatdata. Raised from the wrong thread.
The goal for me is to log the errors raised from a Javascript console.log command in a webview, but when the javascript console.log is fired I get the above error even if I read the console.log string on the IDE Log window (so that mean that the setup of webchromeclient and webviewextra stuff is correct).
I've read in a post in the forum that the logcat event runs in a different thread, and that the solution is to use the Threading Library and that is needed to only declare and initialized a thread object to making it work. I've done that but the problem still remain .
Pls, someone could post an example on how to catch data from the LogCatData events correctly?
Many thanks.
I've a problem with LogCat event.
I start the logcat using
B4X:
objLog.LogCatStart(Args, "objLog")
then in the objLog_LogCatData I would catch the logdata
B4X:
Sub objLog_LogCatData (Buffer() As Byte, Length As Int)
Dim data As String
data = BytesToString(Buffer,0,Length,"UTF-8")
' DO SOMTHING WITH DATA
End Sub
But when i start LogCatStart, I get the following error
Ignoring event: objlog_logcatdata. Raised from the wrong thread.
The goal for me is to log the errors raised from a Javascript console.log command in a webview, but when the javascript console.log is fired I get the above error even if I read the console.log string on the IDE Log window (so that mean that the setup of webchromeclient and webviewextra stuff is correct).
I've read in a post in the forum that the logcat event runs in a different thread, and that the solution is to use the Threading Library and that is needed to only declare and initialized a thread object to making it work. I've done that but the problem still remain .
Pls, someone could post an example on how to catch data from the LogCatData events correctly?
Many thanks.