a guest Apr 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- onSaveInstanceState -> hold view states after rotation or other stuff (that destroys activicy)
- pro : inflating and findViewById both take a lot of resouces so it doesn't make sense to use
- them again in onSaveInstanceState, so we save the views inflated in onCreate as class fields
- * Android stores some of the views' states by default. but we have to save some of them manually
- We can also save previous states for an activity. Like going back to the countries fragment. reloading the data, and automatically scrolling to where we left.
- Review files.
- Viewing files -> Device File Explorer
- Saving files -> in storage vs cache vs ext storage. filesDir, cacheDir, getExternalFilesDir()
- don't store sensitive data on cache, other apps can delete it
- * TIP : do file stuff in a seperate thread. especially when working with heavy files
- Really important stuff -> Difference between different file methods/directories and their permissions
- Styles, Style inheritance, android styles, extending android framework styles (using parent)
- Themes -> ColorPrimary
- Different activities -> FragmentActivity, AppCompatActivity
- Changing theme -> AndroidManifest.xml
- changing theme in code -> setTheme()
- Material design -> material.io Google's standard design guideline.
- Material design library components -> add dependency to manifest -> user Theme.MaterialComponents.*
- Really important stuff -> Different Entities in recyclerview adapter. And keeping their correct order. notifyItemChanged and stuff
RAW Paste Data