Edm*_*jas 4 java android sharedpreferences
如果我要在android偏好中设置一个键/值对,那么在保持键的同时返回并将值取消为null的最佳方法是什么?我想要做的是以编程方式设置和取消设置值,提前感谢.
Mat*_*ris 10
它很简单:
yourEditor.remove("your key to remove");
Run Code Online (Sandbox Code Playgroud)
你必须记得照常提交:
yourEditor.commit();
Run Code Online (Sandbox Code Playgroud)