Bug? Disappearing TabHost tabs

wspaun

New Member
Licensed User
Longtime User
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.

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
 

wspaun

New Member
Licensed User
Longtime User
Screenshot_2013-12-07-09-02-01.jpg
Screenshot_2013-12-07-09-02-24.jpg


Here are two screen shots of the TabHost view. The first one is what displays most of the time with the tabs visible and the second is what displays about 10% of the time with the tabs invisible or hidden. Thanks Erel for taking a look at this.
 

Attachments

  • Screenshot_2013-12-07-09-02-01.png
    Screenshot_2013-12-07-09-02-01.png
    108.1 KB · Views: 185
  • Screenshot_2013-12-07-09-02-01.png
    Screenshot_2013-12-07-09-02-01.png
    108.1 KB · Views: 187

wspaun

New Member
Licensed User
Longtime User
I am only setting the tab text. Here is a simple example project I created which demonstrates the same disappearing tabs problem. Again, I have only noticed the tabs disappearing on Android 4.1.2. Thanks.
 

Attachments

  • Disappearing Tabs.zip
    482.7 KB · Views: 215
Top