Premium

Associate Android Developer Certification Questions and Answer (Dumps and Practice Questions)



Question : Which of the following is not an Activity lifecycle call-back method?

 : Which of the following is not an Activity lifecycle call-back method?
1. onStart

2. onCreate

3. onPause

4. onBackPressed

Correct Answer : 4
Explanation: The Activity class defines the following call backs i.e. events. You don't need to implement all the callbacks methods. However, it's important that you understand each one and implement those that ensure your app behaves the way users expect.

Callback Description
onCreate() This is the first callback and called when the activity is first created.
onStart() This callback is called when the activity becomes visible to the user.
onResume() This is called when the user starts interacting with the application.
onPause() The paused activity does not receive user input and cannot execute any code and called when the current activity is being paused and the previous activity is being resumed.
onStop() This callback is called when the activity is no longer visible.
onDestroy() This callback is called before the activity is destroyed by the system.
onRestart() This callback is called when the activity restarts after stopping it.




Question : Which method is used to close an activity?

 : Which method is used to close an activity?
1. Destroy()

2. Finish()

3. Stop()

4. Close()

Correct Answer : 2
Explanation: When calling finish() on an activity, the method onDestroy() is executed this method can do things like:

Dismiss any dialogs the activity was managing.
Close any cursors the activity was managing.
Close any open search dialog
Also, onDestroy() isn't a destructor. It doesn't actually destroy the object. It's just a method that's called based on a certain state. So your instance is still alive and very well* after the superclass's onDestroy() runs and returns.Android keeps processes around in case the user wants to restart the app, this makes the startup phase faster. The process will not be doing anything and if memory needs to be reclaimed, the process will be killed




Question : Which of the following Activity life-cycle methods is called once the activity is no longer visible?

 : Which of the following Activity life-cycle methods is called once the activity is no longer visible?
1. onStop

2. onPause

3. onDestroy

4. onHide

Correct Answer : 1
Explanation: The Activity class defines the following call backs i.e. events. You don't need to implement all the callbacks methods. However, it's important that you understand each one and implement those that ensure your app behaves the way users expect.

Callback Description
onCreate() This is the first callback and called when the activity is first created.
onStart() This callback is called when the activity becomes visible to the user.
onResume() This is called when the user starts interacting with the application.
onPause() The paused activity does not receive user input and cannot execute any code and called when the current activity is being paused and the previous activity is being resumed.
onStop() This callback is called when the activity is no longer visible.
onDestroy() This callback is called before the activity is destroyed by the system.
onRestart() This callback is called when the activity restarts after stopping it.


Related Questions


Question : Which of the following is correct about XML layout files?

 : Which of the following is correct about XML layout files?
1. In order to display a Ul defined in the XML layout file "main.xml", call the setContentView method of theActivity with the parameter string "main.xml".

2. There is no distinction between implementation of the layout definition by code, or by XML layout file.

3. In an Eclipse project using the ADT plugin, the XML layout file is found in the /res/layout directory.

4. Layout information written in the XML layout file will be converted into code by the Android platform whenthe screen is displayed.


Question : The DalvikVM core libraries are a subset of which of the following?

 : The DalvikVM core libraries are a subset of which of the following?
1. Java ME

2. Java SE

3. Java EE

4. JAX-WS


Question : Which of the following is correct about file access in the Android system?

 : Which of the following is correct about file access in the Android system?
1. Generally, files are handled as dedicated resources per each application.

2. Files created by an application can be directly accessed by any application.

3. The content of file created by application cannot be accessed by any other application.

4. You can only access a file from within an Activity.


Question : Which is the correct explanation of ListView?

 : Which is the correct explanation of ListView?
1. It is necessary to use ListView as a set with ListActivity.

2. You cannot use a ListView when there is no information to be displayed.

3. When displaying a list of Strings using an ArrayAdapter class in ListView, you must save the value in anArrayList.

4. ListView has a function to display a list of uniquely defined Views other than TextView.


Question : Which of following is incorrect about the Toast class?

 : Which of following is incorrect about the Toast class?
1. You cannot set a custom layout for a Toast.

2. A Toast can only created by an Activity class

3. Access Mostly Uused Products by 50000+ Subscribers

4. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT orToast.LENGTH_LONG


Question : Which does not have a lifecycle?

 : Which does not have a lifecycle?
1. Service

2. MediaPlayer

3. Access Mostly Uused Products by 50000+ Subscribers

4. Activity