ArminKH
Well-Known Member
hi i want to measure the line count of a label
here is my code
the above code always return 0 value
i know the ui must be refreshed and by using CallSubDelayed maybe my problem can be solved but my codes is in a while loop and i cant wait for callsubdelayed and if use callsubdelayed still my code not worked in a while loop
my problem is not just in activity create and this is just a sample to reproduce my problem
so please suggest a good solution
can we measure line count without javaobject?
thanx all
here is my code
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim lbl As Label
lbl.Initialize("")
Activity.AddView(lbl,10dip,10dip,100dip,70dip)
lbl.Text = "test text , test text , test text , test text , test text , test text"
lbl.TextSize = 12
Log(getLineCount(lbl))
End Sub
private Sub getLineCount(TargetView As Object) As Int
Dim Source = TargetView As JavaObject
Return Source.RunMethod("getLineCount",Null)
End Sub
the above code always return 0 value
i know the ui must be refreshed and by using CallSubDelayed maybe my problem can be solved but my codes is in a while loop and i cant wait for callsubdelayed and if use callsubdelayed still my code not worked in a while loop
my problem is not just in activity create and this is just a sample to reproduce my problem
so please suggest a good solution
can we measure line count without javaobject?
thanx all