Initializing from Array

edgeryder1000

Member
Licensed User
Longtime User
My code gets the scroll position of the current scrollview (created in an array and put inside a viewpager). The code works (it displays the toast with correct scrollposition), but it also gives an error
"An error has occurred in
sub:main_button1_click(java line: 915)
java.lang.RuntimeException: Object
should first be initialized(View).
Did you forget to call
Activity.LoadLayout?
Continue?"​
But I think I have initialized everything.
B4X:
Sub Button1_Click
            Dim a As Panel
            a.Initialize("a")
            a = Container.GetPageObject(CurrentPage)
            For i = 0 To a.NumberOfViews
                a.GetView(i)
                If a.GetView(i).Tag = CurrentChapter Then
                    Dim c As ScrollView
                    c.Initialize(0)
                    'Panel1.Tag = i   
                    c=a.GetView(i)                   
                    ToastMessageShow(c.ScrollPosition, True)
                End If
            Next
End Sub
Help in fixing this greatly appreciated
 
Top