- first thanks
@roerGarcia and
@Erel for your precious reply to my post and sorry for late reply from my side.
- lets come to the point - i solved the error by following below steps.
- after i posted above problem to the forum. I got different error in logs section like this - IllegalMonitorStateException.
- So i searched for it on the forum.
-
@Erel as you said in this post -
https://www.b4x.com/android/forum/t...e-locked-illegalmonitorstateexception.123101/
(move the specific code outside the loop. First you create a list with all the data and then you insert it with a single call.)
- i moved this code outside the for loop - B4XTable1.SetData(l) 'l is my list name.
- and after it app crashing is stopped in B4a and b4j both.
- below i posted code of before error is solved and after error is solved.
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://mysitename/?paramter_name=paramter_passed")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim rtest As String
'Log(j.GetString)
rtest=j.GetString
rtest=rtest.SubString(22)
'Log(rtest)
Dim parser As JSONParser
'parser.Initialize(j.GetString)
parser.Initialize(rtest)
Dim l As List
l.Initialize
Dim Root2 As Map = parser.NextObject
Dim data As List = Root2.Get("data")
For Each coldata As Map In data
Dim Userparamter1 As String = coldata.Get("paramter1")
Dim Userparamter2 As String = coldata.Get("paramter2")
If Userparamter1<>"1" Then
l.Add(Array(Userparamter1 , Userparamter2))
B4XTable1.SetData(l)
'l.Clear
End If
Next
Dim status As String = Root2.Get("status")
Else
'Msgbox("Please connect to internet","")
xui.MsgboxAsync("Please connect To internet","")
End If
j.Release
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://mysitename/?paramter_name=paramter_passed")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim rtest As String
'Log(j.GetString)
rtest=j.GetString
rtest=rtest.SubString(22)
'Log(rtest)
Dim parser As JSONParser
'parser.Initialize(j.GetString)
parser.Initialize(rtest)
Dim l As List
l.Initialize
Dim Root2 As Map = parser.NextObject
Dim data As List = Root2.Get("data")
For Each coldata As Map In data
Dim Userparamter1 As String = coldata.Get("paramter1")
Dim Userparamter2 As String = coldata.Get("paramter2")
If Userparamter1<>"1" Then
l.Add(Array(Userparamter1 , Userparamter2))
'l.Clear
End If
Next
B4XTable1.SetData(l)
Dim status As String = Root2.Get("status")
Else
'Msgbox("Please connect to internet","")
xui.MsgboxAsync("Please connect To internet","")
End If
j.Release