删除共享的首选项键/值对 [英] Remove Shared preferences key/value pairs
本文介绍了删除共享的首选项键/值对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将一些付款值存储在一个活动中
I store some payment values in one Activity
SharedPreferences spreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
productId = spreferences.getString("productId", "");
purchaseToken = spreferences.getString("purchaseToken", "");
orderId = spreferences.getString("orderId", "");
现在我以另一种方式检索它们
Now I retrieve them in another one as
SharedPreferences spreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
productId = spreferences.getString("productId", "");
purchaseToken = spreferences.getString("purchaseToken", "");
orderId = spreferences.getString("orderId", "");
我的问题是检索它们后在第二个活动中将其删除.谢谢.
My question is to delete them in the second Activity after retrieving them.Thanks.
推荐答案
查看全文