Activities

Alex Neves
Flashcards by Alex Neves, updated more than 1 year ago
Alex Neves
Created by Alex Neves over 5 years ago
10
1

Description

Bachelors Degree Computer Science (Mobile Device Programming) Flashcards on Activities, created by Alex Neves on 01/05/2016.

Resource summary

Question Answer
What is an Activity? An android component which represents the UI. The UI is defined in a view.xml
How do Activities relate to android applications? An android application consists of a stack of activities
What is a View? A UI element
Name the 3 types of Views Display View, Interactive View and View Group
What is the name given to a View which can be interacted with? Widget
What is a View Group? A View which contains a collection of child views
Name 3 types of View layouts Linear, Scroll and Relative
State the 6 states of the Activity Lifecycle Created, Started, Resumed, Paused, Stopped and Destroyed
What type of object is used to persist / restore activity state? Bundles
What is a Bundle? A collection of key-value pairs
Under what circumstances are onSaveInstance / onRestoreInstance State called? If the activity is destroyed by the Android OS
Give 2 examples of when restoration of state may occur When the OS is low on resources and destroys the stopped activity and if the screen orientation changes
How are Activities started? Using Intents
What is an Intent? An object used to start other activities
Give an example of a Uri-based Intent new Intent(ACTION_DIAL, new Uri("tel:07123456");
Give an example of an Intent targeting a particular activity new Intent(context, OtherActivity.class);
How can we request a result from an activity? Using startActivityForResult()
How does the onActivityResult() method identify which activity the result came from? By checking the provided ID against the ID supplied when calling startActivityForResult()
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Intake7 BIM L1
Stanley Chia
Data Types
Jacob Sedore
CCNA Answers – CCNA Exam
Abdul Demir
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
Database Replication
Michael Mahfouz
Data Analytics
anelvr