-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignUpActivity.java
More file actions
59 lines (50 loc) · 2 KB
/
Copy pathSignUpActivity.java
File metadata and controls
59 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.example.bibek.userlogin;
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;
/**
* Created by bibek on 6/23/17.
*/
class SignUpActivity extends AppCompatActivity implements View.OnClickListener {
EditText setname,setnumber,setemail,setusername,setpassword,setage;
Button save;
SharedPreferences sharedPreferences;
SharedPreferences.Editor editor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_up);
setname = (EditText)findViewById(R.id.setname);
setnumber = (EditText)findViewById(R.id.setnumber);
setage = (EditText)findViewById(R.id.setage);
setemail = (EditText)findViewById(R.id.setemail);
setusername = (EditText)findViewById(R.id.setUsername);
setpassword = (EditText)findViewById(R.id.setpassword);
save = (Button)findViewById(R.id.setsave);
sharedPreferences = getSharedPreferences("prefName",MODE_APPEND);
save.setOnClickListener(this);
}
@Override
public void onClick(View view) {
String name = setname.getText().toString();
String number = setnumber.getText().toString();
String age = setage.getText().toString();
String email = setemail.getText().toString();
String username = setusername.getText().toString();
String password = setpassword.getText().toString();
editor = sharedPreferences.edit();
editor.putString("name",name);
editor.putString("number",number);
editor.putString("age",age);
editor.putString("email",email);
editor.putString("username",username);
editor.putString("password",password);
editor.apply();
Intent i = new Intent(this,MainActivity.class);
startActivity(i);
}
}