tags:

views:

100

answers:

1

I'm trying to simplify my views and get rid of some of the nested layouts, and I noticed while looking at the hierarchyviewer that embedded Activities in a TabHost have a PhoneWindow$DecorView. Is there a way I can get rid of this?

An example is here:

http://www.vimtips.org/media/hv.png

A: 

Yes, yes you can, but it's basically useless.:

Window w = mLocalActivityManager.loadActivity(id, intent);
View decor = w.getDecorView();
ViewGroup frame = (ViewGroup)decor.findViewById(android.R.id.content);

View view = frame.getChildAt(0);
frame.removeView(view);

You can then add view to your ActivityGroup content view. The only problem is that the LocalActivityManager can no longer manage it, meaning, when you switch away from this "tab", and try to come back to it, frame.getChildAt(0) will return null. Caching it will probably work, but other things also are no longer managed, like the options menu, etc etc.

synic