TabHost tabs disappear occasionally when displaying WebViews.
I have an application that loads 3 WebViews into 3 tabs on a TabHost view. The app then uses the WebView.LoadUrl method to load 3 small HTML files from the directory assets files folder into each WebView. Finally, the TabHost1.CurrentTab is set by the tabNumber variable which is one of 3 values depending on which button the user selects on another page.
Everything works just great when connected to anyone of a number of the emulators, but when I am running on my Galaxy s2 (Android 4.1.2) or my android tablet (Android 4.1.2), 10% of the time when the TabHost view loads, the tabs disappear. They are still there because when you touch the tab area they reappear, or when you scroll down in the WebView they also reappear. At the same time, I do not have this disappearing tab problem when running on a Galaxy S4 (Android 4.2.2) or a Motorola Defy XT (Android 2.3.7) or a Galaxy Exhibit 4 (Android 2.3.6). Perhaps this could be a problem with Android 4.1.2.
Is this a bug or is there some way I can keep the tabs from disappearing? Thanks ahead of time for any help on this problem. I absolutely love everything about Basic4Android.
I have an application that loads 3 WebViews into 3 tabs on a TabHost view. The app then uses the WebView.LoadUrl method to load 3 small HTML files from the directory assets files folder into each WebView. Finally, the TabHost1.CurrentTab is set by the tabNumber variable which is one of 3 values depending on which button the user selects on another page.
Everything works just great when connected to anyone of a number of the emulators, but when I am running on my Galaxy s2 (Android 4.1.2) or my android tablet (Android 4.1.2), 10% of the time when the TabHost view loads, the tabs disappear. They are still there because when you touch the tab area they reappear, or when you scroll down in the WebView they also reappear. At the same time, I do not have this disappearing tab problem when running on a Galaxy S4 (Android 4.2.2) or a Motorola Defy XT (Android 2.3.7) or a Galaxy Exhibit 4 (Android 2.3.6). Perhaps this could be a problem with Android 4.1.2.
Is this a bug or is there some way I can keep the tabs from disappearing? Thanks ahead of time for any help on this problem. I absolutely love everything about Basic4Android.
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("layStyle")
TabHost1.AddTab("Visual", "layWebView2")
wbvInfo2.LoadUrl("file:///android_asset/visual.html")
TabHost1.AddTab("Auditory", "layWebView3")
wbvInfo3.LoadUrl("file:///android_asset/auditory.html")
TabHost1.AddTab("Tactile", "layWebView4")
wbvInfo4.LoadUrl("file:///android_asset/tactile.html")
TabHost1.CurrentTab = Act3Styles.tabNumber
End Sub