The project has 1 Activity , 1 Tabhost. The tabhost has 2 pages with 2 separate layouts. Each page has several views (edittext, labels, buttons). They are all added via the designer and are all part of the same activity as a parent. If you test the TabHost.b4a sample you supply, you will see the same phenomenon happening. I am not sure what you mean by your following statement:
Activity.NumberOfViews returns the number of views that were added directly to the activity. It will not show other views.
Below is an excerpt of my code:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayoutMain")
Activity.Title="GAS FLOW CALCULATIONS & PLATE SIZE SELECTION"
TabHost1.AddTab("MCFD CALCULATION", "LayoutOrifice")
TabHost1.AddTab("PLATE SIZE SELECTION", "LayoutPlate")