CORRECT ANSWERS ALREADY
PASSED
What is the name of the layout file for the main activity?
a. MainActivity.java
b. AndroidManifest.xml
c. activity_main.xml
d. build.gradle - Answer-C
Is a View also known as a Widget in Android?
a. True
b. False
c. Can be true or false - Answer-A
Which XML attribute do you use in a LinearLayout to show views side by side?
a. android:orientation="horizontal"
b. android:orientation="vertical"
c. android:layout_width="wrap_content"
d. android:layout_weigh="1" - Answer-A
How many views can you use within a ScrollView?
a. One view only
b. One view or one view group
c. As many as you need - Answer-B
Which tag is used to define themes?
a. <style>
b. <theme>
c. <meta-tag>
d. <styling> - Answer-A
Assume you have a TextView with a textSize attribute of 16sp. This TextView also has
a style applied to it which sets textSize to 14sp. In addition, there is also a theme in the
app that sets textSize to 12sp.
What is the actual textSize of the TextView that will be displayed on screen?
a. 12sp
,b. 14sp
c. 16sp
d. 18sp - Answer-C
What is the correct signature for a method used with the android:onClick XML attribute?
a. public void callMethod()
b. public void callMethod(View view)
c. private void callMethod(View view)
d. public boolean callMethod(View view) - Answer-B
Which rule applies to a click handler called from the attribute in the layout?
a. The click handler method must include the event listener View.OnClickListener, which
is an interface in the View class
b. The click handler method must be public, return void, and define a View as its only
parameter.
c. The click handler must customize the View.OnClickListener class and override its
click handler to perform some action.
d. The click handler method must be private and return a View.
(ĐÁP ÁN CÓ THỂ CHƯA CHÍNH XÁC, KIỂM TRA LẠI NẾU CẦN) - Answer-C
Which of the following statements accurately reflect what happens when a user enters
text via the Android virtual keyboard?
a. The onStart() hook method is called back and the activity becomes visible
b. The onResume() hook method is called back to return UI focus for this screen
c. The UI focus is unchanged and no lifecycle hook methods are called
d. A new activity is started and its onCreate() hook method is called - Answer-A
Which control works as a dropdownlist in Android?
a. ComboBox
b. List
c. Spinner
d. DropList - Answer-C
When is activity paused?
a. If activity is at background and still visible
b. If activity is not visible
c. If the activity is at foreground and visible
d. If the activity is at foreground - Answer-A
Which Activity lifecycle methods are best to use for saving data before the Activity is
finished?
a. onPause() or onStop()
b. onResume() or onCreate()
c. onDestroy()
d. onRestart() - Answer-A
, Which of the following should be used to save the unsaved data and release resources
being used by an Android application?
a. Activity.onStop()
b. Activity.onDestroy()
c. Activity.onPause()
d. Activity.onShutdown() - Answer-B
In order to open screenB from screenA and receive data from screenB, which sentence
should we use?
a. startActivityForResult
b. startActivity
c. startActivities
d. startActivityResult - Answer-A
Which method can you call to shut down an activity?
a. finishActivity()
b. finish()
c. destroy()
d. stop() - Answer-B
When in the Activity lifecycle is onSaveInstanceState() called?
a. onSaveInstanceState() is called before the onStop() method.
b. onSaveInstanceState() is called before the onResume() method.
c. onSaveInstanceState() is called before the onCreate() method.
d. onSaveInstanceState() is called before the onDestroy() method. - Answer-A
Which lifecycle method is called to make an activity visible?
a. onPause()
b. onVisible()
c. onDestroy()
d. onStart() - Answer-D
In which of components does sender specify type of receiver?
a. Implicit intent
b. Explicit intent
c. Service intent
d. Component - Answer-A
Which constructor method do you use to create an implicit Intent to launch a camera
app?
a. new Intent()
b. new Intent(Context context, Class<?> class)
c. new Intent(String action, Uri uri)
d. new Intent(String action) - Answer-D
Which of the following correctly describe what an intent is in Android?