For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:<SwitchPreference android:id="@+id/notification" android:key="@string/pref_notification_key" 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(s): A
For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:<ListPreference android:id="@+id/order_by" android:key="@string/pref_sort_key" android:title="@string/pref_sort_title" android:summary="@string/pref_sort_summary" android:dialogTitle="@string/pref_sort_dialog_title" android:entries="@array/sort_oder" android:entryValues="@array/sort_oder_value" android:defaultValue="@string/pref_default_sort_value" app:iconSpaceReserved="false" />In our Fragment, we can dynamically get current notification preference value in this way:
Answer(s): D
For example, we have a file in our raw folder app/src/main/res/raw/sample_teas.json. To get anInputStream for reading it, from out Context context, we can do this:
Answer(s): C
For example, we have a BufferedReader reader, associated with the json file throughInputStreamReader. To get a file data we can do this:
For example, we have a file in our assets folder app/src/main/assets/sample_teas.json. To get an InputStream for reading it, from out Context context, we can try do this:
Answer(s): B
Post your Comments and Discuss Google ASSOCIATE ANDROID DEVELOPER exam prep with other Community members: