JAVA里面已经将EditText的数据提取出来了,但是怎么输出到txt里面,直接打的话提示格式不对该怎么修改啊
2015-05-13
展开全部
static public String getData(Context context, String key) {
// getSharedPreferences
SharedPreferences scDB = context.getSharedPreferences(key, 0);
return scDB.getString(key, "");
}
static public void setData(Context context, String key, String value) {
SharedPreferences scDB = context.getSharedPreferences(key, 0);
SharedPreferences.Editor mEditor = scDB.edit();
mEditor.putString(key, value);
mEditor.commit();
}
存取都有了……自取吧
// getSharedPreferences
SharedPreferences scDB = context.getSharedPreferences(key, 0);
return scDB.getString(key, "");
}
static public void setData(Context context, String key, String value) {
SharedPreferences scDB = context.getSharedPreferences(key, 0);
SharedPreferences.Editor mEditor = scDB.edit();
mEditor.putString(key, value);
mEditor.commit();
}
存取都有了……自取吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询