zoukankan      html  css  js  c++  java
  • 3.8 第一次个人作业4

    zhuceActivity

    package com.example.tiwenzhuce;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.text.Editable;
    import android.text.TextWatcher;
    import android.util.Log;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.Toast;
    
    import java.util.Map;
    
    public class zhuceActivity extends AppCompatActivity {
        private EditText mEtUserName;//声明空间
        private EditText et_1;
        private EditText et_2;
        private String strname;
        private String strpasswd;
        private SharedHelper sh;
        private Context mContext;
        private Button mBtnzhuce2;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_login);
            mContext = getApplicationContext();
            sh = new SharedHelper(mContext);
            et_1 = findViewById(R.id.et_1);
            et_2 = findViewById(R.id.et_2);
            mBtnzhuce2 = findViewById(R.id.btn_zh_2);
            mBtnzhuce2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    strname = et_1.getText().toString();
                    strpasswd = et_2.getText().toString();
                    sh.save(strname, strpasswd);
                    Toast.makeText(zhuceActivity.this, "注册成功!", Toast.LENGTH_SHORT).show();
                    Intent it = new Intent(zhuceActivity.this, TiWenzhuce.class);
                    zhuceActivity.this.startActivity(it);
                }
            });
        }
    }
  • 相关阅读:
    集合和函数
    列表,元组和字典
    运算符与基本数据类型(int,boolean,str)
    html入门新感悟
    Http协议
    java编程基础(四)函数与数组
    java编程基础(三)流程控制语句
    java编程基础(二)java中的运算符
    用html和css来编辑一个简单的html页面
    Oracle golden gate 技术详解
  • 原文地址:https://www.cnblogs.com/dty602511/p/14913581.html
Copyright © 2011-2022 走看看