AndroidAPS/app/src/main/java/info/nightscout/androidaps/AgreementActivity.java

45 lines
1.4 KiB
Java
Raw Normal View History

2016-07-07 18:04:36 +02:00
package info.nightscout.androidaps;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
2017-02-22 20:29:41 +01:00
import info.nightscout.utils.SP;
2016-07-07 18:04:36 +02:00
public class AgreementActivity extends Activity {
boolean IUnderstand;
CheckBox agreeCheckBox;
Button saveButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_agreement);
2017-02-22 20:29:41 +01:00
IUnderstand = SP.getBoolean(R.string.key_i_understand, false);
2016-07-07 18:04:36 +02:00
setContentView(R.layout.activity_agreement);
agreeCheckBox = (CheckBox)findViewById(R.id.agreementCheckBox);
agreeCheckBox.setChecked(IUnderstand);
saveButton = (Button)findViewById(R.id.agreementSaveButton);
addListenerOnButton();
}
public void addListenerOnButton() {
saveButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
2017-02-22 20:29:41 +01:00
SP.putBoolean(R.string.key_i_understand, agreeCheckBox.isChecked());
2016-07-07 18:04:36 +02:00
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
finish();
}
});
}
}