How to implement the registration page with Android
In this article, the editor introduces in detail "how to achieve the registration page for Android", the content is detailed, the steps are clear, and the details are handled properly. I hope this "how to achieve registration page for Android" article can help you solve your doubts.
The effect picture of the implementation:
Code:
Package com.example.project309; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.CheckBox;import android.widget.EditText;import android.widget.RadioButton;import android.widget.TextView; public class MainActivity extends AppCompatActivity {EditText name; EditText password; RadioButton man; RadioButton woman; Button show; TextView shower; CheckBox auto; CheckBox remember; String result= "" Override protected void onCreate (Bundle savedInstanceState) {super.onCreate (savedInstanceState); setContentView (R.layout.activity_main); name = findViewById (R.id.name); password = findViewById (R.id.password); man = findViewById (R.id.man); woman = findViewById (R.id.woman); show = findViewById (R.id.show); shower = findViewById (R.id.shower) Auto = findViewById (R.id.auto); remember = findViewById (R.id.remember); show.setOnClickListener (this::onClick);} public void onClick (View v) {String user = name.getText (). ToString (); result + = "name:" + user+ "\ n"; String pass = password.getText (). ToString (); result + = "password:" + pass+ "\ n" If (man.isChecked ()) {result+= "gender:" + man.getText (). ToString () + "\ n" + "setting:";} if (woman.isChecked ()) {result+= "gender:" + woman.getText (). ToString () + "\ n" + "setting:" } if (auto.isChecked ()) {result+=auto.getText () .toString () + ";} if (remember.isChecked ()) {result+=remember.getText () .toString () +";} shower.setText (result);}}
XML:
After reading this, the article "how to realize the registration page for Android" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.