ListView issue

Ash

Member
Licensed User
Longtime User
Hi,
newbie here so go easy on me :sign0104:

Having bother with a ListView control at the moment.
I've written code to populate a ListView with rows from a MySQL table.
When I run in Debug & in Release with the AVD everything works fine and all rows are displayed as expected.

When in install to an actual device (Samsung Galaxy 10.1 tab) however the list appears blank.

Any ideas why this would happen?? All help and suggestions appreciated.
 

kickaha

Well-Known Member
Licensed User
Longtime User
At a guess it sounds like it is not finding the table.

Post your code up so we can have a look at it.
 
Upvote 0

Ash

Member
Licensed User
Longtime User
At a guess it sounds like it is not finding the table.

Post your code up so we can have a look at it.


Sorry, forgot to paste it in ... code as follows:

B4X:
Sub ExecuteRemoteQuery(Query As String, TaskId As Int)
        Dim req As HttpRequest
   req.InitializePost2("Http://www.myserver.com/ShowEvents.php", Query.GetBytes("UTF8"))
   hc.Execute(req, TaskId)
End Sub


B4X:
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Try
   Dim res As String
   res = Response.GetString("UTF8")
   Dim parser As JSONParser
   parser.Initialize(res)
   Select TaskId
      Case 1
         Dim events As List
         events = parser.NextArray
         For i = 0 To events.Size - 1
            Dim m As Map
            m = events.Get(i)
                                Dim iEventID As Int            
                                Dim sEventDate, sEventName As String
            
            iEventID=m.Get("idx")
            sEventDate = m.Get("EventDate")
            sEventName= m.Get("EventName")
            lstEvents.AddSingleLine(iEventID & " : " & sEventDate & " - " & sEventName)
         Next
      End Select
   ProgressDialogHide
   Response.Release
Catch
   
   ProgressDialogHide
   Response.Release
End Try

End Sub

When running in development on my pc the results are shown in the emulator as expected, but not on the device.
 
Last edited:
Upvote 0

Ash

Member
Licensed User
Longtime User
Actually it may be down to the wifi network I was using. Just tried it on a different network and hey presto it worked!
 
Upvote 0
Top