Scrollview and StringUtils Problem

SemiKolon

Member
Licensed User
Longtime User
Hi!

I have some trouble getting scrollview and MeasureMultilineTextHeight to work :(
When I try to access the item from the list i get the error: "NullPointerException"

B4X:
Sub ListPs_ItemClick (Position As Int, Value As Object)
    Activity.title = Value
   sclView.Initialize(1000)
   lblText.Initialize("")
   lblText.TextSize = 16
   lblText.text = text2
   Activity.AddView(sclView, 0, 140, 100%x, 100)    
   StrUtil.MeasureMultilineTextHeight(lblText, text2)
   lblItem.Initialize("")
    sclView.Panel.AddView(lblItem, 20, 0 ,90%x, 100%y)  
   sclView.Panel.AddView(lblText, 20, 50 ,90%x, 100) 
   sclView.Panel.Height = 100
   ListPs.Visible = False
   imgPs.Visible = False
   imgX.Visible = False
   lblDescription.Visible = False
   lblItem.text = Value
   lblItem.Typeface = Typeface.DEFAULT_BOLD
   lblItem.TextSize = 20
   lblText.height = 100
End Sub

What am I doing wrong? :sign0163:
 

specci48

Well-Known Member
Licensed User
Longtime User
What are you trying to do?
You did not select any Item from the list which had to be done using the sub-parameters "Position" and/or "Value".

And what kind of variable is text2? It is not set withing the provided sub.


specci48
 
Upvote 0
Top