Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("1")
svScroll.Initialize(1dip)
Activity.AddView(svScroll, 0, 0, 100%x, 50%y)
etText.Initialize("")
svScroll.Panel.AddView(etText, 0, 0, 100%x, 50%y)
etText.InputType = etText.INPUT_TYPE_NONE
etText.Gravity = Gravity.TOP
etText.SingleLine = False
etText.Wrap = False
Dim sbText2 As StringBuilder
sbText2.Initialize
For x = 0 To 100
Select Case x
Case 4, 8, 10, 12, 16, 21, 22, 23, 24, 25, 26, 27, 28
sbText2.Append("Helloxxxxxxxxxxxxx...............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" & Chr(10) & Chr(10))
Case Else
sbText2.Append("testing " & x & " xxxxxxxxxxxxx...............................................xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" & CRLF)
End Select
Next
Dim lbl As EditText
lbl.Initialize("")
Activity.AddView(lbl, 0, 0, 100%x * 3, 50%y)
etText.Text = sbText2.ToString
lbl.TextSize = etText.TextSize
lbl.Text = sbText2.ToString
Dim su As StringUtils
Dim edheight As Int = su.MeasureMultilineTextHeight(lbl, lbl.Text)
lbl.RemoveView
svScroll.Panel.Height = edheight
etText.Height = edheight
End Sub