100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

Summary Activity Lifecycle: CSC2002S Mobile Design and Development Module (MDD)

Beoordeling
-
Verkocht
-
Pagina's
2
Geüpload op
17-10-2022
Geschreven in
2022/2023

These notes cover the sections: Android, activity lifecycle, design principles, evaluation, everyday design, views, widgets, layouts, security, software architecture, understanding users and ideas, prototypes, products. These are all the topics you need to ace the MDD section of the exam, which is 33.3% of the paper.

Meer zien Lees minder
Instelling
Vak








Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
17 oktober 2022
Aantal pagina's
2
Geschreven in
2022/2023
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

// set the user interface layout for this activity
// the layout file is defined in the project res/layout/main_activity.xml file setContentView(R.layout.main_activity)
// initialize member TextView so we can manipulate it later
Activity Lifecycle
textView = findViewById(R.id.text_view)
}
// This callback is called only when there is a saved instance that is previously saved by using onSaveInstanceState().
→ The different states (that your application can move through) and callbacks helps the OS to manage resources and // We restore some state in onCreate(), while we can optionally restore other state here, possibly usable after onStart() has complete
// The savedInstanceState Bundle is same as the one used in onCreate().
application interrupts.
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
**KNOW & UNDERSTAND THESE STATES
textView.text = savedInstanceState?.getString(TEXT_VIEW_KEY)
}
** REFER TO SLIDES FOR EXAMPLES:
// invoked when the activity may be temporarily destroyed, save the instance state here
override fun onSaveInstanceState(outState: Bundle?) {
outState?.run {
https://s3-us-west-2.amazonaws.com/secure.notion-static.com/33dd8baf-86f3-4d89-bad4-7e08dae67ae2/MDD07-activit putString(GAME_STATE_KEY, gameState) putString(TEXT_VIEW_KEY, textView.text.toString())
ies.pdf }
// call superclass to save any view hierarchy
super.onSaveInstanceState(outState)
}
→ Extend the base activity class
→ Override functions
→ Only implement functions that you need
→ Call the super class method
→ Pay attention to what you re building and destroying
→ What part of the lifecycle is the app currently in?
Activity lifecycle methods are called automatically depending on
the OS needs and the stage they are in.
Initiate the UI in onCreate() User Navigation
Use onSaveInstanceState() and onRestoreInstanceState() to Handle Home and Back buttons gracefully
preserve state
It’s important to distinguish between the navigation buttons
Most users don’t know the difference – be gracious!
Interruptions: Lifecycle management is especially important
due to resource management constraints Home button
Calls onStop(), onStart()
The app is stopped but not destroyed
Implementing Activities
Back button
The Activity Class
Goes back to previous activity (unless you’ve overridden this)
Calls onStop(), onDestroy()
lateinit var textView: TextView
// some transient state for the activity instance Important when implementing multiple Activities (data retention)
var gameState: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
// call the super class onCreate to complete the creation of activity like // the view hierarchy Screen Rotation
super.onCreate(savedInstanceState)
→ Your Activity will be destroyed and recreated each time the screen rotates. Needs to re-render & re-build the screen
// recovering the instance state based on the new screen layout.
gameState = savedInstanceState?.getString(GAME_STATE_KEY)
Activity Lifecycle 1 Activity Lifecycle 2
€2,61
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
chloewalt University of Cape Town
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
24
Lid sinds
3 jaar
Aantal volgers
12
Documenten
36
Laatst verkocht
2 weken geleden

4,8

6 beoordelingen

5
5
4
1
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen