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
You don't show enough code.
How did you add the WebView to the TabHost ?
To get the most efficient help you should post your project as a zip file (IDE menu Files / Export As Zip).
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.
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
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.