wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Android Activity Worksheet

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What is an Activity in Android?

a)

A background process

b)

An application component representing a single screen with a user interface

c)

A data storage unit

d)

A service class

2.

What method is used to start another activity in Android?

a)

startIntent()

b)

runActivity()

c)

startActivity()

d)

beginActivity

3.

Which class is used to describe an operation to be performed in Android?

a)

Bundle

b)

Intent

c)

ActivityManager

d)

Manifest

4.

Which type of Intent starts a specific activity?

a)

Explicit Intent

b)

Implicit Intent

c)

Broad Intent

d)

Service Intent

5.

Which method allows sending data between activities?

a)

Intent

b)

BroadcastReceiver

c)

Service

d)

ContentProvider

6.

To start an activity and expect a result, which method is used?

a)

startIntent()

b)

startActivityForResult()

c)

startResult()

d)

requestActivity()

7.

What is the purpose of the Android manifest?

a)

To list app permissions

b)

To declare activities and components

c)

To manage app data

d)

Both A and B

8.

Which function retrieves an integer extra from an intent?

a)

getIntExtra()

b)

getData()

c)

getBundle()

d)

getInfo()

9.

Which of the following is NOT a type of intent?

a)

Explicit Intent

b)

Implicit Intent

c)

Remote Intent

d)

Broadcast Intent

10.

What is the first step in creating a new activity?

a)

Write a Java class

b)

Define layout in XML

c)

Add intent filter

d)

Register it in manifest

11.

What is stored in a Bundle?

a)

Database schema

b)

Key-value pairs of data

c)

Layout information

d)

Image resources

12.

What happens when a new activity starts?

a)

The previous one is destroyed

b)

It is pushed to the activity stack

c)

The system halts

d)

None of the above

13.

Which callback receives data from another activity?

a)

onResult()

b)

onActivityResult()

c)

onReturn()

d)

onReceiveData()

14.

What type of navigation uses the device’s back button?

a)

Up navigation

b)

Back navigation

c)

Down navigation

d)

Parent navigation

15.

Which method sets the result to be returned to the parent activity?

a)

setDataResult()

b)

setActivityResult()

c)

setResult()

d)

sendResult()

16.

Which of the following best defines “Extras” in Intents?

a)

Additional methods

b)

Key-value data passed between activities

c)

Backup data storage

d)

UI elements

17.

What lifecycle state is entered when an activity becomes invisible?

a)
onPause()
b)

onStop()

c)

onDestroy()

d)

onCreate()

18.

The “Main Activity” in an app is:

a)

The launcher activity

b)

The service handler

c)

The intent receiver

d)

The app’s database

19.

Which component manages the Android back stack?

a)

ActivityManager

b)

FragmentManager

c)

IntentService

d)

RuntimeLoader

20.

Which method assigns focus to a specific view?

a)

setFocusable()

b)

requestFocus()

c)

gainFocus()

d)

setFocus()

21.

Which class is the base for all UI components in Android?

a)

Activity

b)

View

c)

Layout

d)

Widget

22.

What does the EditText class provide?

a)

Displaying images

b)

Multiple lines of text input

c)

Animation control

d)

Navigation options

23.

What input type conceals typed characters?

a)

textAutoCorrect

b)

textPassword

c)

textEmailAddress

d)

textCapSentences

24.

Which view responds to user tapping or pressing?

a)

TextView

b)

Button

c)

EditText

d)

Spinner

25.

What is a Floating Action Button (FAB)?

a)

A circular, raised button for a primary action

b)

A navigation drawer

c)

A system icon

d)

A dialog component

26.

What is the difference between a checkbox and a radio button?

a)

A. Checkboxes allow multiple selections; radio buttons allow only one

b)

B. Both allow multiple selections

c)

C. Radio buttons are for text input

d)

D. Checkboxes are for numeric input

27.

Which view group is used to organize radio buttons?

a)

LinearLayout

b)

RadioGroup

c)

GridLayout

d)

FrameLayout

28.

What is a Spinner used for?

a)

Numeric calculation

b)

Displaying text

c)

Selecting one value from a list

d)

Showing alerts

29.

What does an adapter do in a Spinner?

a)

Converts data into a viewable format

b)

Handles clicks

c)

Loads layout

d)

Stores string arrays

30.

Which dialog type allows the user to pick a date?

a)

AlertDialog

b)

DatePickerDialog

c)

TimePickerDialog

d)

OptionDialog

31.

Which class helps detect touch gestures?

a)

MotionEvent

b)

GestureDetectorCompat

c)

TouchEvent

d)

InputManager

32.

Which method sets the listener when a view’s focus changes?

a)

setFocusListener()

b)

setOnFocusChangeListener()

c)

onFocusChanged()

d)

getFocusListener()

33.

What is the function of onClickListener?

a)

To handle touch gestures

b)

To handle button click events

c)

To manage layouts

d)

To display menus

34.

Which input control allows only one selection from a dropdown list?

a)

Toggle

b)

Spinner

c)

CheckBox

d)

RadioGroup

35.

What method retrieves the current focused view?

a)

getCurrentFocus()

b)

findFocus()

c)

getViewFocus()

d)

locateFocus()

36.

What is a fragment?

a)

A reusable portion of UI within an activity

b)

A database table

c)

A layout file

d)

A resource string

37.

What gesture is recognized as a long press?

a)

Fling

b)

Drag

c)

Long touch

d)

Scroll

38.

Which file defines the order of focus among input controls?

a)
strings.xml
b)

manifest.xml

c)

layout XML

d)

gradle.build

39.

Which file is used for layout in Android development?

a)

manifest.xml

b)

layout XML

c)

gradle.build

d)

(No option provided)

40.
  1. How can a button’s click be handled in XML?

a)

android:onClick attribute

b)

setClick() method

c)

handleTap attribute

d)

callOnClick() method