Android Question Error since upgrade to last SDK

gerardguerin

Member
Licensed User
Longtime User
It's just a coincidence but since I updated the Android SDK I get an error:
java.lang.RuntimeException: Object shoulds first be initialized (View).

This come from the lib: CustomListView

Any ideas?

B4X:
Public Sub GetItemFromView(v As View) As Int
   Dim parent As Object
   Dim current As Object
  
   parent = v    '<----- In error
  
   Do While (parent Is Panel) = False Or sv.Panel <> parent
     current = parent
     Dim jo As JavaObject = current
     parent = jo.RunMethod("getParent", Null)
   Loop
   v = current
   Return v.Tag
End Sub
 

gerardguerin

Member
Licensed User
Longtime User
The view is a CustonListView, it initialized and it contain a list, this append when press on one item to retrieve their position

' Initilisation
Public lstFind As CustomListView

'Call to
Dim index As Int = lstFind.GetItemFromView(Sender)
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
Ok it resolved, I compare with another similar project I do and I just move the request before the msgbox, I think the msgbox delay (user) is too long and lost reference that cause the problem.

Thank
 
Upvote 0
Top