1/26
Looks like no tags are added yet.
How do you start a new Activity using an Intent?
startService(intent)
startContent(intent)
startBroadcast(intent)
startActivity(intent)
startActivity(intent)
We can not instantiate UI elements during runtime.
True
False
False
View is something that the user can see and interact with.
True
False
True
What are the main types of Intents?
Internal and External
Direct and Indirect
Static and Dynamic
Correct answer:
Explicit and Implicit
Explicit and Implicit
An app is running in the foreground when a phone call arrives, displaying a small dialog-themed incoming call window over the top of the app. The user can still see the app's UI partially blurred or obscured in the background. Which lifecycle method is called on the main activity when this dialog appears?
onDestroy()
onStop()
onSaveInstanceState()
onPause()
onPause()
Activity class takes care of creating a window for you in which you can place your UI with setContentView(View)
True
False
True
Activity is one of the most important component for any android app. Activities are the User Interface (UI) screens which user see.
True
False
True
We can use the Intent.getExtras() in the target activity/class to get the attached bundle and extract the data stored in it.
True
False
True
Linear layout is an example of ______________.
Layout Attributes
ViewGroup
Controls
View
ViewGroup
The onClickListener is an event handler.
True
False
False
Intent can be use to launch an activity.
True
False
True
When you switch from one activity to another, the first activity will no longer be visible on your screen, in this case, the callback method ___________ is called.
onPause()
onResume()
onDestroy()
onStop()
onStop()
An app is running in the foreground when a phone call arrives, displaying a small dialog-themed incoming call window over the top of the app. The user can still see the app's UI partially blurred or obscured in the background. Which lifecycle method is called on the main activity when this dialog appears?
onPause()
onDestroy()
onSaveInstanceState()
onStop()
onPause()*
The onResume() callback method is called whenever the activity becomes visible to the user.
True
False
True*
When the user exits an application, which of the following is correct?
onStop() will be called first before onDestroy()
onDestroy() will be called first before onStop()
the application will only call onStop()
the application will only call onDestroy()
i
iv only
ii only
ii and iii
i*
This is the last callback method in Android’s activity life cycle.
onRestart()
onStop()
onDestroy()
onResume()
onDestroy()*
When you open an application, onResume() method is called after.
onCreate()
onStop()
onPause()
onStart()
onStart()*
TextView is an example of ________.
Event
View
ViewGroup
Resource ID
View
An individual UI component generally referred to as a "widget".
Layout
View
Resource
ViewGroup
View
The onClickListener is called when the user either clicks or touches or focuses upon any widget like button, text, image etc.
True
False
False
In Android, layouts are typically defined in JSON file format.
True
False
False
What is a layout in Android?
A resource file for app strings
A class for managing events
A background image for an Activity
A container that defines the structure of a user interface
A container that defines the structure of a user interface
We can use the Intent.getExtras() in the target activity/class to get the attached bundle and extract the data stored in it.
True
False
True
What is the purpose of getIntent() in an Activity?
To send a result back to the caller
To return the Intent that started the Activity
To create a new Intent
To destroy the current Intent
To return the Intent that started the Activity
Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it.
True
False
True
What are the main types of Intents?
Explicit and Implicit
Direct and Indirect
Static and Dynamic
Internal and External
Explicit and Implicit
How do you start a new Activity using an Intent?
startBroadcast(intent)
startService(intent)
startActivity(intent)
startContent(intent)
startActivity(intent)