Android Interview Questions For Freshers and Experience
How many activity call backs methods in android ? Show/HideAnswer : six - onCreate(), on Start(), on Resume(), onPause(), onStop() and onDestroy()
Oncreate() receives parameters of savedInstancestate, which is ______ object
Show/HideAnswer: Its a Bundle Object which contains the acivities previously saved state.
If activity has never existed before, the value of Bundle object is ?
Show/HideAnswer: Null
Which call back methods are called immediately after onCreate() method finishes ?
Show/HideAnswer: onStart() and onResume()
Which call back method initializes the code that maintains UI(User Interface)
Show/HideAnswer: onstart() method
In what stage users interacts with app ?
Show/HideAnswer: onResume() state
When interruption events happens like receiving a phone call or screen turnoff, which callback method is called ?Show/HideAnswer: onPause()
If user leaving activity, which callback method is calledShow/HideAnswer: onPause()
If activity is no longer visible to user, which callback methods is called by systemShow/HideAnswer: onStop()On which callback method instance, usually saves information to databaseShow/HideAnswer: onStop()
Which callback method is called while activity been destroyed ?Show/HideAnswer: onDestroy()
To start new activity which callback method is called?Show/HideAnswer: startActivity() or startActivityForResult()
Which object as to pass in startActivity() or startActivityForResult() ?Show/HideAnswer: Intent object
Why Intent object is used ?Show/HideAnswer: To specify exactly to start an activity or action to perform
Why startActivityForResult() is used ?Show/HideAnswer:If we want result back from an activity. Ex : If user selects contact number from list of Contacts, When its ends, it has to returns the contact number which as selected.
Which call back method is called when user presses Back Button ?Show/HideAnswer: finish() method
Activity is recreated after it previously destroyed, we can recover saved state from ?Show/HideAnswer: Bundle
For Restoring the state, we can implement __________ or ___________Show/HideAnswer: onCreate or onRestoreInstanceState(). In onRestoreInstanceState() system calls after onStart() method.