Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a non-embedded activity and why doesn't android:fitsSystemWindows work in it?

I'm trying to use the android:fitsSystemWindows attribute on a view so that it does not get blocked by my translucent navigation bar, but it's not doing anything. The Android documentation on it says fitsSystemWindows "Will only take effect if this view is in a non-embedded activity."

What is an embedded activity? Would it be possible for me to have accidentally created one? And is it possible to get the effect of fitsSystemWindows within one?

like image 746
ario Avatar asked Sep 16 '14 16:09

ario


1 Answers

An embedded Activity is an Activity which is hosted inside a parent Activity. The common example being the TabHost/TabActivity design. In particular, embedded Acitvities reside in the host's LocalActivityManager, which is conceptually similar to the FragmentManager which allows you to display one Activity inside another.

Given this definition, it is easy to understand why only the host (non embedded) Activity can support the fitsSystemWindows attribute, as any embedded Activities are restricted to the area defined by their host.

It is very unlikely you will have accidentally created one.

See: android: using ActivityGroup to embed activities

like image 163
TheIT Avatar answered Sep 28 '22 17:09

TheIT