The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:
When using an ImageView, ImageButton, CheckBox, or other View that conveys information graphically. What attribute to use to provide a content label for that View?
When using an EditTexts or editable TextViews, or other editable View. What attribute to use to provide a content label for that View?
If constant LENGTH_INDEFINITE is used as a parameter for the setDuration method in Snackbar, what will happen?
In application theme style, flag windowDrawsSystemBarBackgrounds (
For example, we have a file in our raw folder app/src/main/res/raw/sample_teas.json. To get an
InputStream for reading it, from out Context context, we can do this:
Relative positioning is one of the basic building blocks of creating layouts in ConstraintLayout. Constraints allow you to position a given widget relative to another one. What constraints do not exist?
When scheduling unique work, you must tell WorkManager what action to take when there is a conflict. You do this by passing an enum when enquing the work. For one-time work, you provide an ExistingWorkPolicy, which supports some options for handling the conflict. (Choose four.)
What is a correct part of an Implicit Intent for sharing data implementation?
What method should we use with Notification.Builder to supply a PendingIntent to be sent when the notification is clicked?