package teammemes.tritonbudget;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
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.Toast;


public class Enter_Info extends AppCompatActivity {
    SharedPreferences sharedpreferences;
    // backend
    //Database mydb;
    //MenuDataSource menuDS;
    // frontend
    private EditText name;
    private EditText money;
    //private EditText id;
    private Button btnDone;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_enter__info);
        // Frontend inti.
        name = (EditText) findViewById(R.id.EnterName);
        money = (EditText) findViewById(R.id.EnterMoney);
        btnDone = (Button) findViewById(R.id.btnConfirm);
        sharedpreferences = getSharedPreferences("mypref", Context.MODE_PRIVATE);

        // add data button
        addData();

    }

    public void addData() {
        btnDone.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        SharedPreferences.Editor editor = sharedpreferences.edit();
                        editor.putString("name", name.getText().toString());
                        editor.putString("balance", money.getText().toString());
                        editor.commit();
                        Toast.makeText(Enter_Info.this, "Thanks", Toast.LENGTH_LONG).show();
                        Intent intent = new Intent(getApplicationContext(), HomeScreen.class);
                        startActivity(intent);
                    }

                }
        );
    }


}

@@ -1118,17 +1118,16 @@
   %7D%0A%0A   
- 
 public v
@@ -1138,24 +1138,24 @@
 addData() %7B%0A
+
         btnD
@@ -1331,66 +1331,58 @@
     
-SharedPreferences.Editor editor = sharedpreferences.edi
+User you=User.getInstance(getApplicationContex
 t()
+)
 ;%0A  
@@ -1407,32 +1407,20 @@
     
-editor.putString(%22name%22,
+you.setName(
  nam
@@ -1472,36 +1472,42 @@
     
-editor.putString(%22balance%22, 
+you.setBalance(Double.parseDouble(
 mone
@@ -1533,50 +1533,11 @@
 g())
+)
 ;%0A
-                        editor.commit();
 %0A   
@@ -1588,17 +1588,16 @@
 fo.this,
- 
 %22Thanks%22
@@ -1597,17 +1597,16 @@
 Thanks%22,
- 
 Toast.LE
@@ -1652,123 +1652,15 @@
     
-Intent intent = new Intent(getApplicationContext(), HomeScreen.class);%0A                        startActivity(intent
+finish(
 );%0A 

Update Enter_Info.java