private void aeroMindMaps(List<Details> mList) {
for (Details bean : details) {
final String urlChar = bean.getUrl();
final int idno = bean.getId();
SharedPreferences pref =getActivity().getSharedPreferences("pref", Context.MODE_PRIVATE);
SharedPreferences.Editor edt = pref.edit();
edt.putString("urlid",urlChar);
edt.putInt("urlidno",idno);
edt.commit();
Log.e("idno for mindmaps01",String.valueOf(idno));
我正在获得第一个日志正确,并且在下一个日志中获得0,我只写了一次日志,但在logcat中获取值4次
我的sharedPreference的输出是:
04-15 13:59:25.480 13612-13612/com.example.****.tabview E/idno for mindmaps01: 68
04-15 13:59:25.547 13612-13612/com.example****.tabview E/idno for mindmaps01: 0
04-15 13:59:25.625 13612-13612/com.example.****.tabview E/idno for mindmaps01: 68
04-15 13:59:25.691 13612-13612/com.example.****.tabview E/idno for mindmaps01: 0