Android: when / why should I use FrameLayout instead of Fragment?

The detail container is a FrameLayout because the Fragment that is displayed will be replaced using FragmentTransaction‘s replace() method.

The first argument to replace() is the ID of container whose Fragments will be replaced. If the FrameLayout in this example were replaced with a Fragment, then both the WorkStationListFragment and whatever detail Fragment is currently shown would be replaced by the new Fragment. By encapsulating the Fragment within a FrameLayout, you can replace just the details.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)