开发者

any one line code to remove single value from Shared Preference?

开发者 https://www.devze.com 2023-03-19 23:09 出处:网络
Is there any one line code to remove a value or index from shared preference. something like: SharedPrefere开发者_C百科nce.remove(\"FILENAME\", value)If you are looking for one line solution you could

Is there any one line code to remove a value or index from shared preference. something like: SharedPrefere开发者_C百科nce.remove("FILENAME", value)


If you are looking for one line solution you could use something like this

SharedPreference sp;
// initialize it
sp.edit().remove("value_key").commit();

But i don't see any point of using it like this unless you wan't to make your colleagues life harder while reading it.

0

精彩评论

暂无评论...
验证码 换一张
取 消