Erstellt von Alex Neves
vor fast 9 Jahre
|
||
Frage | Antworten |
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() |
Möchten Sie mit GoConqr kostenlos Ihre eigenen Karteikarten erstellen? Mehr erfahren.