Working with Custom View. To define custom attributes, we can add
An overridden method onCreateOptionsMenu in an Activity returns boolean value. What does this value mean?
The following code snippet shows an example of an Espresso test:
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.)
“Set the activity content to an explicit view. This view is placed directly into the activity's view hierarchy. It can itself be a complex view hierarchy.” This can be done by calling method:
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:
Custom duration in milliseconds as a parameter for the setDuration method is available when you are working with:
In application theme style, flag windowActionBar (
A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time. For example, a Play button might change to a Pause button during music playback. In these cases, to update the content label at the appropriate time, we can use:
For example, we have a BufferedReader reader, associated with the json file through
InputStreamReader. To get a file data we can do this:
For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:
android:title="@string/pref_notification_title" android:summary="@string/pref_notification_summary" android:defaultValue="@bool/pref_notification_default_value" app:iconSpaceReserved="false"/> In our Fragment, we can dynamically get current notification preference value in this way:
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can then use the tools in the Debugger tab to identify the state of the app. With Step Over you can
To create a basic JUnit 4 test class, create a class that contains one or more test methods. A test method begins with the specific annotation and contains the code to exercise and verify a single functionality in the component that you want to test. What is the annotation?
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can
then use the tools in the Debugger tab to identify the state of the app. With Step Out you can
The Layout Inspector in Android Studio allows you to compare your app layout with design mockups, display a magnified or 3D view of your app, and examine details of its layout at runtime. When this is especially useful?
For example, we have a BufferedReader reader, associated with the json file through
InputStreamReader. To get a file data we can do this:
What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)
With a room database. When performing queries, you'll often want your app's UI to update automatically when the data changes. Can you use a return value of type LiveData in your query method description to achieve this?
To run a debuggable build variant you must use a build variant that includes