我想使用“共享首选项”保存意图。我在startActivityforResult中试过这样:
SharedPreferences settings = getSharedPreferences(PREFERENCES, 0);
SharedPreferences.Editor editor = settings.edit();
String uriString = data.toUri(0);
editor.putString("Contacts_app", uriString);
editor.commit();
并检索如下:
SharedPreferences settings = getSharedPreferences(PREFERENCES, 0);
String contactsApp = settings.getString("Contacts_app", null);
try {
telApp = Intent.parseUri(contactsApp, 0);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但这不起作用。我是如何解决这个问题的错误或其他选择?
由于