1. Please check all of the traits that make fragments useful.
2. What is the right sequence in order to dynamically display a fragment.
For example, to start a new activity: A) Create a new Intent that points to the new activity, B) Add any information you want to that Intent, C) Start the intent. The right sequence is ABC.
A- Create a new fragment instance in a host activity
B- Create a new fragment class that inflates a layout
C- Create a layout that defines the appearance of the fragment
D- Add the fragment to it's host activity using the FragmentManager and a fragment transaction
3. Which callback method is called when the Fragment’s user interface becomes visible but is not yet active?
1. We can use multiple fragments in a single activity to build a flexible UI and also reuse those fragments in multiple activities. A fragment has its own life cycle and we can add or remove it while the activity is still running.
So, the correct options are A,B and D.
2. The correct sequence is
Hence the correct option is (C) CBAD
3. The onStart( ) method is called when the Fragment’s user interface becomes visible but is not yet active.
Let me know if you have any doubts in the comments. Please upvote if the answer helped you.
1. Please check all of the traits that make fragments useful. They are reusable They can...