The issue with your modified version is that it waits for a tabhost list in every activity.
I only have 1 activity(layout) that uses tabhost's, the solution would be to rename the sub's and have a different one for layouts that have a tabhost.
In order to make this a more full solution though, is it possible to request from an object to provide all objects that it is a parent of? Ie I could start with the activity and then for each object returned I would query its own children until no objects are parents of an object.
Also about the activity file name, using a variable (I actually use the activity title and map to file names) is my solution now, but wouldnt this be easy to implement on the b4a side? and it would make it easier. To my understanding whenever I load a layout, all other layouts are destroyed so it wouldnt be difficult to have a readonly property for the activity that holds the filename.
Regards