This commit is contained in:
lucashu 2024-05-30 16:00:08 +08:00
parent b297ebacfd
commit 609b1c84ce
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ public class MainActivity extends AppCompatActivity {
public void onClick(View v) { public void onClick(View v) {
SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE); SharedPreferences sharedPreferences = getSharedPreferences("user",MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
// editor.remove("name"); //
editor.clear(); //删除当前文件中所有的值 editor.clear(); //删除当前文件中所有的值
editor.commit(); editor.commit();