Skip to content
Snippets Groups Projects
Commit 6c7b7964 authored by Peter Joseph De Jonckheere CESM2014's avatar Peter Joseph De Jonckheere CESM2014
Browse files

Added settings retrieve

parent 23f6e11b
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,10 @@ import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.Toast;
/**
......@@ -26,8 +28,13 @@ public class Settings extends AppCompatActivity{
retrieveSettings();
}
private void retrieveSettings(View view){
SharedPreferences shared = this.getSharedPreferences()
private void retrieveSettings(){
SharedPreferences shared = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
findViewById(R.id.Audio).setActivated(shared.getBoolean(getString(R.string.audio), false));
findViewById(R.id.Vibration).setActivated(shared.getBoolean(getString(R.string.vibration), false));
findViewById(R.id.LEDFlash).setActivated(shared.getBoolean(getString(R.string.led), false));
findViewById(R.id.spinner).setTop(shared.getInt(getString(R.string.daily_goal), R.integer.notify_period_minutes));
((EditText)findViewById(R.id.notificationMessage)).setText(shared.getString(getString(R.string.daily_goal_text), getString(R.string.notf_text)));
}
private void setUpButtons(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment