Skip to content

Commit

Permalink
Forgot to commit the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfintel committed Jul 20, 2021
1 parent 4a79094 commit c6e3145
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions DozeOff/app/src/main/java/com/dosse/dozeoff/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,27 @@ protected void onCreate(Bundle savedInstanceState) {
findViewById(R.id.doze_off).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("doze_off",((CheckBox)findViewById(R.id.doze_off)).isChecked());
SharedPreferences.Editor e=prefs.edit();
e.putBoolean("doze_off",((CheckBox)findViewById(R.id.doze_off)).isChecked());
e.commit();
applySettings();
}
});
findViewById(R.id.wakelock_cpu).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("wakelock_cpu",((CheckBox)findViewById(R.id.wakelock_cpu)).isChecked());
SharedPreferences.Editor e=prefs.edit();
e.putBoolean("wakelock_cpu",((CheckBox)findViewById(R.id.wakelock_cpu)).isChecked());
e.commit();
applySettings();
}
});
findViewById(R.id.wakelock_wifi).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("wakelock_wifi",((CheckBox)findViewById(R.id.wakelock_wifi)).isChecked());
SharedPreferences.Editor e=prefs.edit();
e.putBoolean("wakelock_wifi",((CheckBox)findViewById(R.id.wakelock_wifi)).isChecked());
e.commit();
applySettings();
}
});
Expand Down

0 comments on commit c6e3145

Please sign in to comment.