Deck 9: Fragments

ملء الشاشة (f)
exit full mode
سؤال
Fragments were introduced in API level ____________.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The Fragment class is final and has no subclass.
سؤال
The ____________ method is called when a fragment is no longer in use.
سؤال
The ____________ method is called when a fragment is detached from its activity.
سؤال
In an app that includes fragments, we cannot have a Model.
سؤال
What method of the Fragment class returns the Activity that this fragment belongs to?

A) activity
B) fragmentActivity
C) getActivity
D) getFragmentActivity
سؤال
Fragments cannot exchange data.
سؤال
We are coding a class encapsulating an invisible fragment. Thus, we do not code the ____________ method.
سؤال
OnEditorActionListener, a public static inner interface of the TextView class, provides the functionality to handle a(n) ____________ event inside an EditText.
سؤال
We can obtain a(n) ____________ reference by calling the getSystemService of the Context class.
سؤال
In order to get a reference to a fragment using its tag name, we call the ____________ method from the FragmentManager class.
سؤال
It is possible to hide a fragment; that is, the fragment is no longer visible but can be shown later.
سؤال
It is possible to replace a fragment with another.
سؤال
One of the add methods of the FragmentTransaction class has this API:
FragmentTransaction add( int containerViewId, Fragment fragment, String s )
What does s represent?

A) A String to be displayed inside the fragment
B) The tag name of the fragment (so we can retrieve it later using that tag name)
C) The title of the fragment
D) The title of the activity
سؤال
What XML attribute can we use to give Views a size relative to the size of the screen (25%, 50%, etc.)?

A) android:layout
B) android:layout_weight
C) android:weight
D) layout_weight
سؤال
If we want to close a keyboard associated with an EditText when the user hits the key Done, what value should we assign to the attribute android:imeOptions?

A) done
B) actionDone
C) end
D) close
سؤال
What method of the Activity class returns the fragment manager for the activity?

A) Manager
B) getManager
C) getFragmentManager
D) fragmentManager
سؤال
What method of the Fragment class returns the root View for this fragment?

A) view
B) fragmentView
C) getView
D) getFragmentView
سؤال
It is possible to define a fragment programmatically without using a layout XML file.
سؤال
If we call the getActivity method inside a user-defined Fragment class and assign the return value to a user-defined Activity class, the Fragment class is not usable with a different user-defined Activity class. To make it reusable with a different user-defined Activity class, we use an interface inside the user-defined Fragment class and have our user-defined Activity class implement that interface.
سؤال
To get a reference to a fragment using its id, we call the __________________ method from the FragmentManager class.
سؤال
A fragment can be defined in an XML layout file using a __________________ XML element.
سؤال
If we intend to call a method of our Activity class with the Activity of a fragment, it is important to __________________ the return object of the getActivity method to that type of Activity.
سؤال
The __________________ method of the InputMethodManager class can be used to close or hide a keyboard.
سؤال
The IBinder interface encapsulates a(n) __________________ object.
سؤال
We can obtain an ____________ reference by calling the getSystemService of the Context class.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/26
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Fragments
1
Fragments were introduced in API level ____________.
eleven
2
The Fragment class is final and has no subclass.
False
3
The ____________ method is called when a fragment is no longer in use.
onDestroy
4
The ____________ method is called when a fragment is detached from its activity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
5
In an app that includes fragments, we cannot have a Model.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
6
What method of the Fragment class returns the Activity that this fragment belongs to?

A) activity
B) fragmentActivity
C) getActivity
D) getFragmentActivity
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
7
Fragments cannot exchange data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
8
We are coding a class encapsulating an invisible fragment. Thus, we do not code the ____________ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
9
OnEditorActionListener, a public static inner interface of the TextView class, provides the functionality to handle a(n) ____________ event inside an EditText.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
10
We can obtain a(n) ____________ reference by calling the getSystemService of the Context class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
11
In order to get a reference to a fragment using its tag name, we call the ____________ method from the FragmentManager class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
12
It is possible to hide a fragment; that is, the fragment is no longer visible but can be shown later.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
13
It is possible to replace a fragment with another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
14
One of the add methods of the FragmentTransaction class has this API:
FragmentTransaction add( int containerViewId, Fragment fragment, String s )
What does s represent?

A) A String to be displayed inside the fragment
B) The tag name of the fragment (so we can retrieve it later using that tag name)
C) The title of the fragment
D) The title of the activity
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
15
What XML attribute can we use to give Views a size relative to the size of the screen (25%, 50%, etc.)?

A) android:layout
B) android:layout_weight
C) android:weight
D) layout_weight
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
16
If we want to close a keyboard associated with an EditText when the user hits the key Done, what value should we assign to the attribute android:imeOptions?

A) done
B) actionDone
C) end
D) close
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
17
What method of the Activity class returns the fragment manager for the activity?

A) Manager
B) getManager
C) getFragmentManager
D) fragmentManager
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
18
What method of the Fragment class returns the root View for this fragment?

A) view
B) fragmentView
C) getView
D) getFragmentView
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
19
It is possible to define a fragment programmatically without using a layout XML file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
20
If we call the getActivity method inside a user-defined Fragment class and assign the return value to a user-defined Activity class, the Fragment class is not usable with a different user-defined Activity class. To make it reusable with a different user-defined Activity class, we use an interface inside the user-defined Fragment class and have our user-defined Activity class implement that interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
21
To get a reference to a fragment using its id, we call the __________________ method from the FragmentManager class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
22
A fragment can be defined in an XML layout file using a __________________ XML element.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
23
If we intend to call a method of our Activity class with the Activity of a fragment, it is important to __________________ the return object of the getActivity method to that type of Activity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
24
The __________________ method of the InputMethodManager class can be used to close or hide a keyboard.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
25
The IBinder interface encapsulates a(n) __________________ object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
26
We can obtain an ____________ reference by calling the getSystemService of the Context class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 26 في هذه المجموعة.