Karteikarten
Activities
Karten in diesem Stapel (18)
- 1What is an Activity?An android component which represents the UI. The UI is defined in a view.xml
- 2How do Activities relate to android applications?An android application consists of a stack of activities
- 3What is a View?A UI element
- 4Name the 3 types of ViewsDisplay View, Interactive View and View Group
- 5What is the name given to a View which can be interacted with?Widget
- 6What is a View Group?A View which contains a collection of child views
- 7Name 3 types of View layoutsLinear, Scroll and Relative
- 8State the 6 states of the Activity LifecycleCreated, Started, Resumed, Paused, Stopped and Destroyed
- 9What type of object is used to persist / restore activity state?Bundles
- 10What is a Bundle?A collection of key-value pairs
- 11Under what circumstances are onSaveInstance / onRestoreInstance State called?If the activity is destroyed by the Android OS
- 12Give 2 examples of when restoration of state may occurWhen the OS is low on resources and destroys the stopped activity and if the screen orientation changes
- 13How are Activities started?Using Intents
- 14What is an Intent?An object used to start other activities
- 15Give an example of a Uri-based Intentnew Intent(ACTION_DIAL, new Uri("tel:07123456");
- 16Give an example of an Intent targeting a particular activitynew Intent(context, OtherActivity.class);
- 17How can we request a result from an activity?Using startActivityForResult()
- 18How does the onActivityResult() method identify which activity the result came from?By checking the provided ID against the ID supplied when calling startActivityForResult()
Informationen
- Beschreibung
- Bachelors Degree Computer Science (Mobile Device Programming) Karteikarten am Activities, erstellt von Alex Neves am 05/01/2016.
- Erstellt von
- Alex Neves
- Aufrufe
- 38
- Tags
- Bewertung