Android learning notes

Creating Views Dynamically

var textViewAppContext = new TextView(getApplicationContext() /* also "this" if you want to do activity */)
// set some stuff on the textView

layout.addView(textViewAppContext)

Context

ViewPager

ViewPager2 is the one I should use

ViewModel

learned from: https://www.youtube.com/watch?v=5qlIPTDE274

View Models survive "Configuration Changes"

Rotating a phone basically tears down your activity and re-creates it

this clears out all local state

ViewModels survive therefore don't have this problem

Also they have a better separation of concerns

WARNING: these do not save their state if the process closes down, onSaveInstanceState does

LiveData

A class that will broadcast changes to data (create reactive data)