Interviewer And Interviewee Guide

Sr. Android Developer Interview Question:

Tell us what is an Activity? Which method is implemented by all subclasses of an Activity?

Submitted by: Muhammad
An Activity is the screen representation of an application in Android.

It serves as an entry point for the user's interaction. Each activity has a layout file where you can place your UI. An application can have different activities. For example, Facebook start page where you enter your email/phone and password to login acts as an activity.

Below are the two methods which almost all subclasses of Activity will implement:

onCreate(Bundle): It is a method where your initialization is done. Under this, you will callsetContentView(int) with a layout resource which defines your UI. Also, you can retrieve the widgets in that UI by using findViewById(Int). These are required to interact programmatically.
onPause(): It is a method which deals with the user whenever it leaves the activity. So any changes made by the user should be committed which is done by the ContentProvider that holds the data.
Submitted by: Muhammad

Read Online Sr. Android Developer Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.