<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="com.example.myapplication.guan"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/txtOne"
android:layout_width="385dp"
android:layout_height="60dp"
android:gravity="center"
android:text="关注的人"
android:textSize="40dp"
android:textColor="#EE6AA7"
android:background="#eeeeee"
/>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/shou"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
>
<TextView android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="修改" android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp" />
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/tv_registeractivity_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1."/>
<EditText
android:id="@+id/et_registeractivity_username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="PDD"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_registeractivity_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2." />
<EditText
android:id="@+id/et_registeractivity_password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:gravity="center_vertical"
android:text="wjm"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_registeractivity_password2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3."/>
<EditText android:id="@+id/et_registeractivity_password2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="坤坤"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:text="baby,看看你都关注了谁"
android:onClick="onClick"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="com.example.myapplication.lian"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/txtTwo"
android:layout_width="385dp"
android:layout_height="60dp"
android:gravity="center"
android:text="联系客服"
android:textSize="40dp"
android:textColor="#EE6AA7"
android:background="#eeeeee"
/>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="18dp"
android:layout_height="29dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/shou"
android:clickable="true"
android:onClick="onClick" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
>
<TextView android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="修改" android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp" />
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/tv_registeractivity_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="电话:"/>
<EditText
android:id="@+id/et_registeractivity_username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="17636283360"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:text="欧尼酱,这是我的联系方式"
android:onClick="onClick"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="com.example.myapplication.liu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/txtOne"
android:layout_width="385dp"
android:layout_height="60dp"
android:gravity="center"
android:text="浏览历史"
android:textSize="40dp"
android:textColor="#EE6AA7"
android:background="#eeeeee"
/>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/shou"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
>
<TextView android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="修改" android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp" />
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/tv_registeractivity_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PDD"/>
<EditText
android:id="@+id/et_registeractivity_username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="你跟我谈请假?"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_registeractivity_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ww" />
<EditText
android:id="@+id/et_registeractivity_password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:gravity="center_vertical"
android:text="有没有大佬组队?求组..."
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:text="亲,这是您的浏览记录哦"
android:onClick="onClick"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="com.example.myapplication.shou"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/txtTwo"
android:layout_width="385dp"
android:layout_height="60dp"
android:gravity="center"
android:text="我的收藏"
android:textSize="40dp"
android:textColor="#EE6AA7"
android:background="#eeeeee"
/>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/shou"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
>
<TextView android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="修改" android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp" />
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/tv_registeractivity_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="题目:"/>
<EditText
android:id="@+id/et_registeractivity_username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="你跟我谈请假?"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_registeractivity_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发帖人:" />
<EditText
android:id="@+id/et_registeractivity_password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:gravity="center_vertical"
android:text="PDD"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:text="哈尼,您的收藏在这儿哟"
android:onClick="onClick"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="com.example.myapplication.liu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/txtOne"
android:layout_width="385dp"
android:layout_height="60dp"
android:gravity="center"
android:text="设置"
android:textSize="40dp"
android:textColor="#EE6AA7"
android:background="#eeeeee"
/>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/shou"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
>
<TextView android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="修改" android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp" />
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:text="当前已是最新版本,无需更新"
android:onClick="onClick"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
package com.example.myapplication;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
public class DBOpenHelper extends SQLiteOpenHelper {
private SQLiteDatabase db;
public DBOpenHelper(Context context) {
super(context, "db_test", null, 1);
db = getReadableDatabase();
}
@Override
public void onCreate(SQLiteDatabase db){
db.execSQL("CREATE TABLE IF NOT EXISTS user(" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT," +
"name TEXT," +
"password TEXT," + "password2 TEXT,"+"password3 TEXT,"+"password4 TEXT,"+"password5 TEXT)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
db.execSQL("DROP TABLE IF EXISTS user");
onCreate(db);
}
public ArrayList<User> getAllData(){
ArrayList<User> list = new ArrayList<User>();
Cursor cursor = db.query("user",null,null,null,null,null,"name DESC");
while(cursor.moveToNext()){
String name = cursor.getString(cursor.getColumnIndex("name"));
String password = cursor.getString(cursor.getColumnIndex("password"));
String password2 = cursor.getString(cursor.getColumnIndex("password2"));
String password3 = cursor.getString(cursor.getColumnIndex("password3"));
String password4 = cursor.getString(cursor.getColumnIndex("password4"));
String password5 = cursor.getString(cursor.getColumnIndex("password5"));
list.add(new User(name,password,password2,password3,password4,password5));
}
return list;
}
public void add(String name,String password, String password2, String password3, String password4, String password5){
db.execSQL("INSERT INTO user (name,password) VALUES(?,?)");
}
public void xian(String name,String password, String password2, String password3, String password4, String password5){
db.execSQL("SELECT * FROM user WHERE name=AND password = AND password2 = AND password3 = AND password4 = AND password5 ="+name+password+password2+password3+password4+password5);
}
public void delete(String name,String password,String password2,String password3,String password4,String password5){
db.execSQL("DELETE FROM user WHERE name = AND password = AND password2 = AND password3 = AND password4 = AND password5 ="+name+password+password2+password3+password4+password5);
}
public void updata(String name,String password,String password2,String password3,String password4,String password5){
db.execSQL("UPDATE user SET name = ?",new Object[]{name});
db.execSQL("UPDATE user SET password = ?",new Object[]{password});
db.execSQL("UPDATE user SET password2 = ?",new Object[]{password2});
db.execSQL("UPDATE user SET password3 = ?",new Object[]{password3});
db.execSQL("UPDATE user SET password4 = ?",new Object[]{password4});
db.execSQL("UPDATE user SET password5 = ?",new Object[]{password5});
}
}
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class guan extends AppCompatActivity implements View.OnClickListener {
private String realCode;
private DBOpenHelper mDBOpenHelper;
private Button mBtRegisteractivityRegister;
private RelativeLayout mRlRegisteractivityTop;
private ImageView mIvRegisteractivityBack;
private LinearLayout mLlRegisteractivityBody;
private EditText mEtRegisteractivityUsername;
private EditText mEtRegisteractivityPassword;
private EditText mEtRegisteractivityPassword2;
private EditText mEtRegisteractivityPassword3;
private EditText mEtRegisteractivityPassword4;
private EditText mEtRegisteractivityPassword5;
private EditText mEtRegisteractivityPhonecodes;
private ImageView mIvRegisteractivityShowcode;
private RelativeLayout mRlRegisteractivityBottom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.guan);
initView();
mDBOpenHelper = new DBOpenHelper(this);
}
private void initView(){
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
mEtRegisteractivityPassword = findViewById(R.id.et_registeractivity_password);
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
mEtRegisteractivityPassword3= findViewById(R.id.et_registeractivity_password3);
mEtRegisteractivityPassword4 = findViewById(R.id.et_registeractivity_password4);
mEtRegisteractivityPassword5 = findViewById(R.id.et_registeractivity_password5);
mIvRegisteractivityBack.setOnClickListener(this);
mBtRegisteractivityRegister.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_registeractivity_back: //返回页面
Intent intent1 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent1);
finish();
break;
case R.id.bt_registeractivity_register: //按钮
//获取信息
String username = mEtRegisteractivityUsername.getText().toString().trim();
String password = mEtRegisteractivityPassword.getText().toString().trim();
String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
String password3 = mEtRegisteractivityPassword3.getText().toString().trim();
String password4 = mEtRegisteractivityPassword4.getText().toString().trim();
String password5 = mEtRegisteractivityPassword5.getText().toString().trim();
//验证
if (1==1) {
Intent intent2 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent2);
finish();
Toast.makeText(this, "返回成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "未完善信息,失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class lian extends AppCompatActivity implements View.OnClickListener {
private String realCode;
private DBOpenHelper mDBOpenHelper;
private Button mBtRegisteractivityRegister;
private RelativeLayout mRlRegisteractivityTop;
private ImageView mIvRegisteractivityBack;
private LinearLayout mLlRegisteractivityBody;
private EditText mEtRegisteractivityUsername;
private EditText mEtRegisteractivityPassword;
private EditText mEtRegisteractivityPassword2;
private EditText mEtRegisteractivityPassword3;
private EditText mEtRegisteractivityPassword4;
private EditText mEtRegisteractivityPassword5;
private EditText mEtRegisteractivityPhonecodes;
private ImageView mIvRegisteractivityShowcode;
private RelativeLayout mRlRegisteractivityBottom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lian);
initView();
mDBOpenHelper = new DBOpenHelper(this);
}
private void initView(){
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
mEtRegisteractivityPassword = findViewById(R.id.et_registeractivity_password);
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
mEtRegisteractivityPassword3= findViewById(R.id.et_registeractivity_password3);
mEtRegisteractivityPassword4 = findViewById(R.id.et_registeractivity_password4);
mEtRegisteractivityPassword5 = findViewById(R.id.et_registeractivity_password5);
mIvRegisteractivityBack.setOnClickListener(this);
mBtRegisteractivityRegister.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_registeractivity_back: //返回页面
Intent intent1 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent1);
finish();
break;
case R.id.bt_registeractivity_register: //按钮
//获取信息
String username = mEtRegisteractivityUsername.getText().toString().trim();
String password = mEtRegisteractivityPassword.getText().toString().trim();
String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
String password3 = mEtRegisteractivityPassword3.getText().toString().trim();
String password4 = mEtRegisteractivityPassword4.getText().toString().trim();
String password5 = mEtRegisteractivityPassword5.getText().toString().trim();
//验证
if (1==1) {
Intent intent2 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent2);
finish();
Toast.makeText(this, "返回成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "未完善信息,失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class liu extends AppCompatActivity implements View.OnClickListener {
private String realCode;
private DBOpenHelper mDBOpenHelper;
private Button mBtRegisteractivityRegister;
private RelativeLayout mRlRegisteractivityTop;
private ImageView mIvRegisteractivityBack;
private LinearLayout mLlRegisteractivityBody;
private EditText mEtRegisteractivityUsername;
private EditText mEtRegisteractivityPassword;
private EditText mEtRegisteractivityPassword2;
private EditText mEtRegisteractivityPassword3;
private EditText mEtRegisteractivityPassword4;
private EditText mEtRegisteractivityPassword5;
private EditText mEtRegisteractivityPhonecodes;
private ImageView mIvRegisteractivityShowcode;
private RelativeLayout mRlRegisteractivityBottom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.liu);
initView();
mDBOpenHelper = new DBOpenHelper(this);
}
private void initView(){
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
mEtRegisteractivityPassword = findViewById(R.id.et_registeractivity_password);
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
mEtRegisteractivityPassword3= findViewById(R.id.et_registeractivity_password3);
mEtRegisteractivityPassword4 = findViewById(R.id.et_registeractivity_password4);
mEtRegisteractivityPassword5 = findViewById(R.id.et_registeractivity_password5);
mIvRegisteractivityBack.setOnClickListener(this);
mBtRegisteractivityRegister.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_registeractivity_back: //返回页面
Intent intent1 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent1);
finish();
break;
case R.id.bt_registeractivity_register: //按钮
//获取信息
String username = mEtRegisteractivityUsername.getText().toString().trim();
String password = mEtRegisteractivityPassword.getText().toString().trim();
String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
String password3 = mEtRegisteractivityPassword3.getText().toString().trim();
String password4 = mEtRegisteractivityPassword4.getText().toString().trim();
String password5 = mEtRegisteractivityPassword5.getText().toString().trim();
//验证
if (1==1) {
Intent intent2 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent2);
finish();
Toast.makeText(this, "返回成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "未完善信息,失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class shou extends AppCompatActivity implements View.OnClickListener {
private String realCode;
private DBOpenHelper mDBOpenHelper;
private Button mBtRegisteractivityRegister;
private RelativeLayout mRlRegisteractivityTop;
private ImageView mIvRegisteractivityBack;
private LinearLayout mLlRegisteractivityBody;
private EditText mEtRegisteractivityUsername;
private EditText mEtRegisteractivityPassword;
private EditText mEtRegisteractivityPassword2;
private EditText mEtRegisteractivityPassword3;
private EditText mEtRegisteractivityPassword4;
private EditText mEtRegisteractivityPassword5;
private EditText mEtRegisteractivityPhonecodes;
private ImageView mIvRegisteractivityShowcode;
private RelativeLayout mRlRegisteractivityBottom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.shou);
initView();
mDBOpenHelper = new DBOpenHelper(this);
}
private void initView(){
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
mEtRegisteractivityPassword = findViewById(R.id.et_registeractivity_password);
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
mEtRegisteractivityPassword3= findViewById(R.id.et_registeractivity_password3);
mEtRegisteractivityPassword4 = findViewById(R.id.et_registeractivity_password4);
mEtRegisteractivityPassword5 = findViewById(R.id.et_registeractivity_password5);
mIvRegisteractivityBack.setOnClickListener(this);
mBtRegisteractivityRegister.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_registeractivity_back: //返回页面
Intent intent1 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent1);
finish();
break;
case R.id.bt_registeractivity_register: //按钮
//获取信息
String username = mEtRegisteractivityUsername.getText().toString().trim();
String password = mEtRegisteractivityPassword.getText().toString().trim();
String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
String password3 = mEtRegisteractivityPassword3.getText().toString().trim();
String password4 = mEtRegisteractivityPassword4.getText().toString().trim();
String password5 = mEtRegisteractivityPassword5.getText().toString().trim();
//验证
if (1==1) {
Intent intent2 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent2);
finish();
Toast.makeText(this, "返回成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "未完善信息,失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class ying extends AppCompatActivity implements View.OnClickListener {
private String realCode;
private DBOpenHelper mDBOpenHelper;
private Button mBtRegisteractivityRegister;
private RelativeLayout mRlRegisteractivityTop;
private ImageView mIvRegisteractivityBack;
private LinearLayout mLlRegisteractivityBody;
private EditText mEtRegisteractivityUsername;
private EditText mEtRegisteractivityPassword;
private EditText mEtRegisteractivityPassword2;
private EditText mEtRegisteractivityPassword3;
private EditText mEtRegisteractivityPassword4;
private EditText mEtRegisteractivityPassword5;
private EditText mEtRegisteractivityPhonecodes;
private ImageView mIvRegisteractivityShowcode;
private RelativeLayout mRlRegisteractivityBottom;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ying);
initView();
mDBOpenHelper = new DBOpenHelper(this);
}
private void initView(){
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
mEtRegisteractivityPassword = findViewById(R.id.et_registeractivity_password);
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
mEtRegisteractivityPassword3= findViewById(R.id.et_registeractivity_password3);
mEtRegisteractivityPassword4 = findViewById(R.id.et_registeractivity_password4);
mEtRegisteractivityPassword5 = findViewById(R.id.et_registeractivity_password5);
mIvRegisteractivityBack.setOnClickListener(this);
mBtRegisteractivityRegister.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.iv_registeractivity_back: //返回页面
Intent intent1 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent1);
finish();
break;
case R.id.bt_registeractivity_register: //按钮
//获取信息
String username = mEtRegisteractivityUsername.getText().toString().trim();
String password = mEtRegisteractivityPassword.getText().toString().trim();
String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
String password3 = mEtRegisteractivityPassword3.getText().toString().trim();
String password4 = mEtRegisteractivityPassword4.getText().toString().trim();
String password5 = mEtRegisteractivityPassword5.getText().toString().trim();
//验证
if (1==1) {
Intent intent2 = new Intent(this, com.example.myapplication.MainActivity.class);
startActivity(intent2);
finish();
Toast.makeText(this, "返回成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this, "未完善信息,失败", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
原文:https://www.cnblogs.com/yyl141/p/13089277.html