王老师:19139051760(拨打)复制微信 题目 更新时间:2024/3/15 请简述SharedPreferences如何存储数据. 答案 登录 注册 1使用Sharedpreference储存数据时因为它本身没有写文件的功能,因此需要使用Editor对象将数据存入内存 2SharedPreferencessp=getSharedPreferences("config",0); 3Editoreditor=sp.edit(); 4editor.putString("a","a"); 5editor.commit(); 出自:联大 >> 郑州科技学院移动程序开发 郑州大学继续教育学院