Sapient Company Programming

To create a fragment, which of the following options holds true?

1) Extend android.app.Fragment class
and create using code snippet below
public class Fragment_Name extends Fragment{
.....

2) Extend android.app.FragmentClass class
and create using code snippet below:
public class Fragment_Name extends Fragment{
....

3) Extend android.app.Fragment class
and create using code snippet below:
public class Fragment_Name extends FragmentClass{
....

4) None of the given options

Read Solution (Total 1)

Sapient Other Question

Which of the following funcations would return layout of a fragment, assuming that funcation is implemented in the fragment class?

1) onCreate()
2) onFragmentView()
3) onView()
4) onCreateView()
Which of the following sequences of Fragment lifecycle methods is correct?

1) onAttach() --> onStart() --> onCreate() --> onCreateView() --> onActivityCreated() --> onResume()

2) onAttach() --> onCreate() --> onStart() --> onCreateView() --> onActivityCreated() --> onResume()

3) OnAttach() --> onCreate() --> onCreateView() --> onActivityCreated() --> onStart() --> onResume()

4) onAttach() -->onStart() --> onCreate() --> onActivityCreated() --> onCreatedView() --> onResumse()