DBUtils HTML Table

BrutalSnyper

Member
Licensed User
Longtime User
I'm trying to show a table of the records in my database on the second tab of my TabHost but the table does not show and I cannot work out why not.

Here is my code:
B4X:
Sub tbhPages_TabChanged
   If tbhPages.CurrentTab = "2" Then
      ShowTableInWebView
   End If
End Sub

Sub ShowTableInWebView
   WebView1.Visible = True
   
   WebView1.LoadHtml(DBUtils.ExecuteHtml(SQL1, _
   "SELECT NameOfNote, NoteText FROM Notes" _
   , Null, 0, True))
End Sub
 

BrutalSnyper

Member
Licensed User
Longtime User
In the designer on the second tab I added the WebView and it is declared.

I don't want to post the project zip file as I do not want to lose all of the work I've done by somebody stealing my application and idea and selling it on the Android Market themselves.
 
Last edited:
Upvote 0

kickaha

Well-Known Member
Licensed User
Longtime User
1) does ShowTableInWebView get called
2) does "SELECT NameOfNote, NoteText FROM Notes" return results
3) if you add a basic web page to WebView1 does it display correctly
 
Upvote 0

BrutalSnyper

Member
Licensed User
Longtime User
1) The table shows when I run ShowTableInWebView on application startup, but not when it's in the tab change module.
This should be sufficient. Thanks.
2) It's currently showing the titles of the columns in the table but not the data, I'm not sure if that is because there is no data or there is a problem with the query.
3) I'll try that now.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
In the designer on the second tab I added the WebView and it is declared.
How did you add the WebView on Tab2 in the Designer ?
You need to add it in the code with TabHost1.AddTab.
The attached demo program shows an example.

Best regards.
 

Attachments

  • TabHostWebViewHTML.zip
    13 KB · Views: 334
Upvote 0
Top