reg.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".RegisterActivity" > <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" /> <TextView
android:id="@+id/tvUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_alignTop="@+id/textView2"
android:text="用户名" /> <TextView
android:id="@+id/tvPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_below="@+id/textView2"
android:layout_marginTop="16dp"
android:text="密码" /> <RadioGroup
android:id="@+id/rdSex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvPassword"
android:layout_below="@+id/etPassword"
android:layout_marginTop="22dp" > <RadioButton
android:id="@+id/man"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="男" /> <RadioButton
android:id="@+id/woman"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/rdSex"
android:layout_centerHorizontal="true"
android:text="女" />
</RadioGroup> <CheckBox
android:id="@+id/cb_hb_std"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/rdSex"
android:layout_below="@+id/rdSex"
android:layout_marginTop="30dp"
android:text="学习" /> <TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/cb_hb_photo"
android:layout_alignLeft="@+id/cb_hb_std"
android:text="爱好" /> <TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/cb_hb_std"
android:layout_below="@+id/cb_hb_std"
android:layout_marginTop="19dp"
android:text="年龄" /> <Spinner
android:id="@+id/spinnerAge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView4"
android:layout_below="@+id/textView4"
android:layout_marginTop="23dp" /> <ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/cb_hb_slp"
android:layout_alignTop="@+id/spinnerAge"
android:src="@drawable/ic_launcher" /> <ProgressBar
android:id="@+id/pb"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView3"
android:layout_toLeftOf="@+id/cb_hb_slp"
android:visibility="gone" /> <Button
android:id="@+id/btnCon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/spinnerAge"
android:layout_alignParentBottom="true"
android:text="确认" /> <CheckBox
android:id="@+id/cb_hb_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView4"
android:layout_alignRight="@+id/etRegUsername"
android:layout_marginRight="44dp"
android:text="摄影" /> <CheckBox
android:id="@+id/cb_hb_slp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView4"
android:layout_marginRight="18dp"
android:layout_toLeftOf="@+id/cb_hb_photo"
android:text="睡觉" /> <TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/rdSex"
android:layout_below="@+id/etPassword"
android:text="性别" /> <EditText
android:id="@+id/etRegUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvUsername"
android:layout_toRightOf="@+id/cb_hb_std"
android:ems="10" > <requestFocus />
</EditText> <EditText
android:id="@+id/etPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tvPassword"
android:layout_alignBottom="@+id/tvPassword"
android:layout_alignLeft="@+id/etRegUsername"
android:layout_alignRight="@+id/etRegUsername"
android:ems="10"
android:inputType="textPassword" /> </RelativeLayout>

  regSucc.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".RegSuccActivity" > <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" /> <TextView
android:id="@+id/cfName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_alignTop="@+id/textView2"
android:text=" 1" /> <TextView
android:id="@+id/cfSex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_below="@+id/textView2"
android:text="TextView" /> <TextView
android:id="@+id/cfHobby"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/cfSex"
android:layout_below="@+id/cfSex"
android:layout_marginTop="28dp"
android:text="TextView" /> <TextView
android:id="@+id/cfSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/cfHobby"
android:layout_below="@+id/cfHobby"
android:layout_marginTop="33dp"
android:text="TextView" /> </RelativeLayout>

  

RegiserActivity.java

public class RegisterActivity extends Activity {
private EditText etRegUsername;
private RadioGroup rgSex;
private Button btnCon;
private Spinner spinnerAge;
private ProgressBar pb;
private CheckBox cb1;
private CheckBox cb2;
private CheckBox cb3;
private List<CheckBox> checkBoxList = new ArrayList<CheckBox>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register); List<String> listAge=new ArrayList<String>();
listAge.add("18");
listAge.add("19");
listAge.add("20");
listAge.add("21");
spinnerAge=(Spinner)this.findViewById(R.id.spinnerAge);
ArrayAdapter adapterAge=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,listAge);
adapterAge.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerAge.setAdapter(adapterAge); btnCon=(Button)this.findViewById(R.id.btnCon);
pb=(ProgressBar)this.findViewById(R.id.pb); rgSex=(RadioGroup)findViewById(R.id.rdSex); etRegUsername=(EditText)findViewById(R.id.etRegUsername);
cb1=(CheckBox)findViewById(R.id.cb_hb_slp);
cb2=(CheckBox)findViewById(R.id.cb_hb_std);
cb3=(CheckBox)findViewById(R.id.cb_hb_photo);
checkBoxList.add(cb1);
checkBoxList.add(cb2);
checkBoxList.add(cb3);
btnCon.setOnClickListener(new View.OnClickListener() { @Override
public void onClick(View arg0) {
pb.setVisibility(View.VISIBLE);
Toast.makeText(RegisterActivity.this, "success", Toast.LENGTH_LONG).show();
Intent itRegSuc=new Intent(RegisterActivity.this,RegSuccActivity.class); String hb =" ";
for (CheckBox checkbox : checkBoxList) {
if (checkbox.isChecked()){
hb+=checkbox.getText().toString() + " ";
}
} String name=etRegUsername.getText().toString();
// Bundle bundle=new Bundle();
// //传递name参数为tinyphp
// bundle.putString("name", name);
// itRegSuc.putExtras(bundle);
RadioButton rbSex=(RadioButton)findViewById(rgSex.getCheckedRadioButtonId());
String sex=rbSex.getText().toString();
String sp=(String)spinnerAge.getSelectedItem();
itRegSuc.putExtra("name", name);
itRegSuc.putExtra("sex", sex);
itRegSuc.putExtra("hobby", hb);
itRegSuc.putExtra("spinner", sp);
startActivity(itRegSuc);
}
}); } @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.register, menu);
return true;
} }

  RegSuccActivity.java

public class RegSuccActivity extends Activity {
private TextView cfName;
private TextView cfSex;
private TextView cfHobby;
private TextView cfSpinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rsg_succ); // Bundle bundle = this.getIntent().getExtras();
// String name=bundle.getString("name");
Intent it=getIntent();
String name=it.getStringExtra("name");
String sex=it.getStringExtra("sex");
String hb=it.getStringExtra("hobby");
String spinner=it.getStringExtra("spinner");
cfName=(TextView)findViewById(R.id.cfName);
cfSex=(TextView)findViewById(R.id.cfSex);
cfSpinner=(TextView)findViewById(R.id.cfSpinner);
cfHobby=(TextView)findViewById(R.id.cfHobby);
cfName.setText(name);
cfSex.setText(sex);
cfHobby.setText(hb);
cfSpinner.setText(spinner);
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.rsg_succ, menu);
return true;
} }

  

Android--普通注册页面实现(无功能)的更多相关文章

  1. Android之注册界面练习

    今天要分享的是一个安卓注册小练习,记录一下自己的学习. 做一个注册页面. 要求填入用户如下信息: 用户名.密码.确认密码.性别(单选).爱好(多选,包括至少六个选项,如音乐.美术.阅读.篮球等).em ...

  2. .Net程序猿乐Android开发---(4)注册页面布局

    接下来我们介绍的登陆页面布局,在本节中,我们看一下注册页面布局,页面布局大同小异,来一起熟悉下基本控件的使用方法. 效果图: 1.加入注冊页面 右键选中layout目录,加入注冊页面.例如以下图 点击 ...

  3. Android笔记-4-实现登陆页面并跳转和简单的注册页面

    实现登陆页面并跳转和简单的注册页面   首先我们来看看布局的xml代码 login.xml <span style="font-family:Arial;font-size:18px; ...

  4. Android程序员学WEB前端(4)-HTML(4)-注册页面-Sublime

    转载请注明出处:http://blog.csdn.net/iwanghang/article/details/76576031 觉得博文有用,请点赞,请评论,请关注,谢谢!~ 注册页面1: <! ...

  5. Android 开启 WebView 页面 Chrome debug

    Android 开启 WebView 页面 Chrome debug WebView debug // 开启 WebView 页面 debug testWebView.setWebContentsDe ...

  6. php登录注册页面及加载

                           php注册界面                               <h1>注册页面</h1> <form acti ...

  7. php做登录注册页面及加载

    //SQL注入攻击 //1.过滤用户的输入 //2.使用预处理语句 //3.写代码的时候尽量避免 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. ...

  8. 使用jQuery开发一个带有密码强度检验的超酷注册页面

    在今天的jQuery教程中,我们将介绍如何使用jQuery和其它相关的插件来生成一个漂亮的带有密码强度检验的注册页面,希望大家喜欢! 相关的插件和类库 complexify - 一个密码强度检验jQu ...

  9. 如何在nopcommerce3.3注册页面添加密码强度检查仪?

    我刚刚完成了nopCommerce注册页面的密码强度检查仪,因为我觉得在电子商务交易平台,安全问题是非常重要的.在注册页面有必要添加一个密码强度检测仪,以便通知用户他们的密码是否足够强大.今天,大多数 ...

  10. 注册页面的简单搭建(H5)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

随机推荐

  1. zabbix--3.0--1

    实验环境 实验用2到2台机器,实验所用机器系统环境如下,可以看到2台机器的主机名和IP地址 [root@linux-node1 ~]# cat /etc/redhat-release CentOS L ...

  2. JavaScript模板引擎Template.js使用详解

    这篇文章主要为大家详细介绍了JavaScript模板引擎Template.js使用方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下   template.js 一款 JavaScript 模板引 ...

  3. spring+mybaits xml配置解析----转

    一.项目中spring+mybaits xml配置解析 一般我们会在datasource.xml中进行如下配置,但是其中每个配置项原理和用途是什么,并不是那么清楚,如果不清楚的话,在使用时候就很有可能 ...

  4. php 过滤器filter_var验证邮箱/url/ip等

    验证邮箱.url或者ip,除了使用正则外,也可以使用内置的函数库过滤器filter来完成这些功能. filter_var (PHP 5 >= 5.2.0, PHP 7)filter_var — ...

  5. MySQL:ROWNUM的假实现

    MySQL中的ROWNUM的实现 MySQL 几乎模拟了 Oracle,SQL Server等商业数据库的大部分功能,函数.但很可惜,到目前的版本(5.7)为止,仍没有实现ROWNUM这个功能. se ...

  6. 具有 Button 风格的 Panel

    unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  7. linux mongodb 及php-mongo扩展安装

    安装背景   php7.2.5   ubuntu18.04.1 MongoDb 安装 sudo apt-get install mongodb MongoDb的php扩展 sudo apt-get i ...

  8. 黄聪:PHP代码获取客户端IP地址经纬度及所在城市

    echo $_SERVER['HTTP_HOST']; //echo $_SERVER['REQUEST_URI']; $getIp=$_SERVER["REMOTE_ADDR"] ...

  9. Python单元测试框架之pytest 3 -- fixtures

    From: https://www.cnblogs.com/fnng/p/4769020.html Python单元测试框架之pytest -- fixtures 2015-08-29 13:05 b ...

  10. SpringSecurity-ChannelProcessingFilter的作用

    ChannelProcessingFilter决定的是web请求的通道,即http或https. 在springsecurity配置文件中添加这样一行 <intercept-url patter ...