Android Activities MCQ Questions
This section focuses on "Activities" in Android. These Multiple Choice Questions (MCQ) should be practiced to improve the Android skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Android system initiates its program with in an Activity starting with a call on ?
A. offCreate() callback
B. onDrop() callback
C. offCreate() callback
D. onCreate() callback
View Answer
Ans : D
Explanation: Android system initiates its program with in an Activity starting with a call on onCreate() callback method
2. Which callback is called when the activity becomes visible to the user?
A. onCreate()
B. onStart()
C. onResume()
D. onPause()
View Answer
Ans : B
Explanation: onStart() : This callback is called when the activity becomes visible to the user
3. Which callback is called when the activity is no longer visible?
A. onRestart()
B. onDestroy()
C. onStop()
D. onPause()
View Answer
Ans : C
Explanation: onStop() : This callback is called when the activity is no longer visible.
4. Which callback is called when the activity restarts after stopping it?
A. onDestroy()
B. onPause()
C. onStart()
D. onRestart()
View Answer
Ans : D
Explanation: onRestart() : This callback is called when the activity restarts after stopping it.
5. If you need to pass data back from an activity, Which method you should use?
A. startActivity()
B. startActivityForResult()
C. ActivityForResult()
D. None of the above.
View Answer
Ans : B
Explanation: startActivityForResult() should use when need to pass data back from an activity.
6. In android mini-activities are also known as
A. Adapter
B. Activity
C. Fragments
D. None of the above
View Answer
Ans : C
Explanation: In android mini-activities are also known as Fragments
7. For creating Fragments the java class needs to extend which base class?
A. MainActivity
B. MiniActivity
C. Fragments
D. None of the above
View Answer
Ans : C
Explanation: For creating Fragments the java class needs to extend Fragments base class.
8. The Log.d() method has been used to generate log messages
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: The Log.d() method has been used to generate log messages
9. An application can have one or more activities without any restrictions.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: An application can have one or more activities without any restrictions.
10. Every activity you define for your application must be declared in your Android.xml file
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: Every activity you define for your application must be declared in your AndroidManifest.xml file and the main activity for your app must be declared in the manifest with an that includes the MAIN action and LAUNCHER category
Discussion