Practice T Flashcards
Is this legal XML (Imagine the <>s)
LinearLayout Button / Button /Button /LinearLayout
Yes
What is the return type of the function findViewBydId(int id)
View
If you declare an XML tag <androidx.appcompat.widget.Toolbar>, is this the normal android libraries or the AppCompat libraries?</androidx.appcompat.widget.Toolbar>
AppCompat libraries
T/F - If you are using the normal Android libraries, you can call setSupportActionBar() to load a toolbar
False.
setSupportActionBar did not exist pre-androidx. You would use setActionBar
What function would you call to set the view of a Dialog box?
setView
For a Checkbox or switch widget, what function do you call to listen for when the user clicks on it?
setOnCheckedChangedListener
What is the default orientation of LinearLayout?
Horizontal
What function do you call on the adapter to redraw the reyclerView when data has been added or removed?
notifyDatasetChanged()
What should the function getView(int, position, View old, ViewGroup parent) use to load a view?
LayoutInflater
if you call getWriteableDatabase() from an SQLiteOpenHelper object and the older version is 1.9 and the new version is 2, what function will get called? What if they’re the same version?
Different: getUpgrade()
Same: Nothing will get called
What function do you call to start an AyncTask?
execute()
If you go to another Activity using startActivity(), does onActivityReult() get called when the next activity terminates?
No
If you create a subclass of AsyncTask<String, Integer, Double>, what is the parameter type of the doInBackground(??) function?
String
AsyncTask<Params, Progress, Result>
How do these 3 sections relate to doInBackground() ?
Params - type of input parameters to pass to doInBackground
Progress - The type of values that represent progress updates
Result - the type returned as a result from doInBackground
What do you call on a recyclerView to listen for users selecting something from the list?
setOnItemClickListener()