What happens when you create a DAO method and annotate it with @Insert?
Example:
@Dao
interface MyDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertUsers(vararg users: User)
}
Answer : A
What is demonstrated by the code below?
// RawDao.java
@Dao
interface RawDao {
@RawQuery
User getUserViaQuery(SupportSQLiteQuery query);
}
// Usage of RawDao
...
SimpleSQLiteQuery query =
new SimpleSQLiteQuery("SELECT * FROM User WHERE id = ? LIMIT 1",
new Object[]{userId});
User user = rawDao.getUserViaQuery(query);
...
Answer : A
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:
Answer : A
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 Into you can
Answer : D
When using an EditTexts or editable TextViews, or other editable View. What attribute to use to provide a content label for that View?
What is a correct part of an Implicit Intent for sharing data implementation?
Answer : D
Create the text message with a string
val sendIntent = Intent().apply { action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, textMessage) type = 'text/plain'
}
For example, we have a BufferedReader reader, associated with the json file through
InputStreamReader. To get a file data we can do this:
Answer : A