Answer: B finish()
Description: Activity can be killed programatically in two ways. finish() or finishActivity(intent); intent should be matching with your activity.
finish() - can be used to kill itself.
finishActivity() - is to allow others to kill your activity.
Answer: C onPrepareOptionsMenu can be used to enable/disable some menu items in an Android application.
Description: onCreateOptionsMenu function will be called only once when application gets loaded for the first time.
After that it will not be called.
onPrepareOptionsMenu will be called each time user clicks menu button.
If you want to enable or disable some of the menu items, then use this function.
Answer: D All
Description:
Answer: B The activity instance is tied to the lifecycle of an activity while the application instance is tied to the lifecycle of an application.
Description: activity context means : this pointer in activity.
application context means : process context which can be obtained by getApplicationContext() function.
this pointer always points to current class object, app context will point to entire process. there is only one app context. if you want to use some control whose life time is through out your application life time then go for app context, else use this pointer (activity context).
Answer: D all are true
Description:
Answer: C both options are true
Description:
Answer: C Call setContentView(mView) in the onCreate() of the main application class.
Description:
Answer: C Activity.onPause()
Description: Activity.onPause() is the only last guaranteed function to be called in activity life cycle, before killing an activity in all the scenarios.
So save all your persistent data in onPause().
Answer: D all options are true
Description: seamlessness means un-interrupted flow of an application. No matter what is happening to your application, user should not feel that disturbance. these disturbances may happen in case of low memory, and configuration changes where android will and recreate the activity. but these changes should not be visible to the user and should not disturb user. this can be done by handling these conditions in onSaveInstantnceState() in all activities.
Answer: B It will start a new activity with matching intent filter, in a new task only if that corresponding task is not in memory now.
Description: Description from developer android documentation:
If this flag is set, then this activity will become the start of a new task on this history stack.
When using this flag, if a task is already running for the activity you are now starting, then a new activity will not be started; instead, the current task will simply be brought to the front of the screen with the state it was last in.
Answer: D This will start a new activity in a new task, where only this activity will be there in that task and no other components. if at all new components are launched from this new activity, they will be launched in a different task.
Description:
Answer: D all
Description:
Answer: B command line tool or batch file to create android project.
Description: Note : this tool is deprecated and no more in use.
Answer: C both options are true
Description:
Answer: B Applying transition and scaling animations while moving from one activity to other activity is called as activity animation, to make it appear as if they are sliding and zooming in and out.
Description:
Answer: D all are true
Description:
Answer: D all are true
Description:
Answer: C both options are true
Description:
Answer: C both are true. But second option gives difference in terms of seconds, where as first one in terms of days, hours.
Description: