ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 52 - Associate Android Developer discussion

Report
Export

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. To mark in the editor that a preference value should be removed, which will be done in the actual preferences once commit() or apply() is called, what method in SharedPreferences.Editor should we use?

A.
delete(String key)
Answers
A.
delete(String key)
B.
clear()
Answers
B.
clear()
C.
remove(String key)
Answers
C.
remove(String key)
D.
removeAll()
Answers
D.
removeAll()
Suggested answer: B

Explanation:

clear() method marks in the editor to remove ALL values from the preferences. Once commit is called, the only remaining preferences will be any that you have defined in this editor.

And no delete and removeAll method exists in SharedPreferences.Editor

asked 18/09/2024
Jhon Doe
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first