공유 환경 설정에서 데이터를 삭제하려고합니다. 그러나 나는 그것을 할 수 없다. 데이터가 제거되거나되지 않았는지 추적하기 위해이 코드를 사용하고 있습니다 :android의 공유 환경 설정에서 데이터 삭제
btnLogout.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
SharedPreferences prefs = getSharedPreferences(share_pref_file, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.remove(share_pref_file);
editor.clear();
editor.commit();
getApplicationContext().getSharedPreferences(share_pref_file, 0).edit().clear().commit();
String strJson = prefs.getString("jsondata","");
if(strJson != null)
{
Log.d("CLEAR", "cccccccccccccccccccccccccccc");
}
userFunctions.logoutUser(getApplicationContext());
Intent login = new Intent(getApplicationContext(),LoginActivity.class);
login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(login);
// Closing dashboard screen
finish();
}
});
그러나 로그 캣 창에서 나를 보여주고있다 "cccccccccccccccccccccccccccc"값마다.
누구나 공유 환경 설정에서 데이터를 삭제/삭제하는 방법을 알려주며 '로그 아웃'버튼을 클릭하면 저장된 데이터가 모두 삭제됩니다. 미리 감사드립니다.
감사합니다 ... 나를 도와줍니다. – Avijit
http://stackoverflow.com/questions/15758775/getting-a-error-out-of-memory-in-android 한 번만이 링크를 확인하십시오. – Avijit