zoukankan      html  css  js  c++  java
  • 安卓作业5

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.login1">
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity android:name=".MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".secondActivity"/>
        </application>
    
    </manifest>
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#F5F4F4"
        android:orientation="vertical"
        tools:context=".MainActivity">
    
        <TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:background="#00BCD4"
            android:enabled="true"
            android:gravity="center"
            android:text="注册界面"
            android:textColor="#FF5722"
            android:textSize="30sp" />
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:gravity="center">
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center">
    
                <TextView
                    android:id="@+id/name"
                    android:layout_width="wrap_content"
                    android:layout_height="30dp"
                    android:enabled="true"
                    android:text="用户名:"
                    android:textSize="20sp"
                    android:textStyle="bold" />
    
                <EditText
                    android:id="@+id/etname"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="textPersonName" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center">
    
                <TextView
                    android:id="@+id/password"
                    android:layout_width="wrap_content"
                    android:layout_height="30dp"
                    android:enabled="true"
                    android:text="密码:"
                    android:textSize="20sp"
                    android:textStyle="bold" />
    
                <EditText
                    android:id="@+id/etpass"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="numberPassword" />
    
            </TableRow>
        </TableLayout>
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:gravity="center">
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center">
    
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:enabled="true"
                    android:text="性别:"
                    android:textSize="20sp"
                    android:textStyle="bold" />
    
                <RadioGroup
                    android:id="@+id/rg"
                    android:layout_width="220dp"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
    
                    <RadioButton
                        android:id="@+id/girl"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="女" />
    
                    <RadioButton
                        android:id="@+id/boy"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="男" />
                </RadioGroup>
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:gravity="center">
    
                <TextView
                    android:id="@+id/textView7"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:enabled="true"
                    android:text="爱好:"
                    android:textSize="20sp"
                    android:textStyle="bold" />
    
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">
    
                    <CheckBox
                        android:id="@+id/print"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="绘画" />
    
                    <CheckBox
                        android:id="@+id/basketball"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="打篮球" />
                </LinearLayout>
    
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center">
    
                <TextView
                    android:id="@+id/textView8"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="20sp" />
    
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">
    
                    <CheckBox
                        android:id="@+id/sing"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="唱歌" />
    
                    <CheckBox
                        android:id="@+id/dance"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="跳舞" />
                </LinearLayout>
            </TableRow>
        </TableLayout>
    
        <Button
            android:id="@+id/button"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="#00BCD4"
            android:text="注册"
            android:textAllCaps="false"
            android:textColor="#252523"
            android:textStyle="bold" />
    
    </LinearLayout>
    复制代码
    复制代码
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <TextView
            android:id="@+id/textView2"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:background="#00BCD4"
            android:gravity="center"
            android:text="注册信息"
            android:textColor="#FF5722"
            android:textSize="25sp" />
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="25dp"
            android:gravity="center"
            android:orientation="vertical">
    
            <TextView
                android:id="@+id/textView3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="你的注册信息是:"
                android:textSize="20sp" />
    
            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="400dp">
    
                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    
                    <TextView
                        android:id="@+id/textView4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="用户名:"
                        android:textSize="20sp" />
    
                    <TextView
                        android:id="@+id/show_name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </TableRow>
    
                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    
                    <TextView
                        android:id="@+id/textView9"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="密码:"
                        android:textSize="20sp" />
    
                    <TextView
                        android:id="@+id/show_pass"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </TableRow>
    
                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    
                    <TextView
                        android:id="@+id/textView11"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="性别:"
                        android:textSize="20sp" />
    
                    <TextView
                        android:id="@+id/show_gender"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </TableRow>
    
                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    
                    <TextView
                        android:id="@+id/textView13"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="爱好:"
                        android:textSize="20sp" />
    
                    <TextView
                        android:id="@+id/show_hobby"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </TableRow>
            </TableLayout>
        </LinearLayout>
    </LinearLayout>
    package com.example.aa;
    
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.widget.EditText;
    import android.widget.TextView;
    
    import com.example.login1.R;
    
    public class secondActivity extends Activity {
    
        public void startActivity(Intent intent){
    
        }
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.news);
            TextView show_name = (TextView)findViewById(R.id.show_name);
            TextView show_pass =(TextView)findViewById(R.id.show_pass);
            TextView show_gender = (TextView)findViewById(R.id.show_gender);
            TextView show_hobby =(TextView)findViewById(R.id.show_hobby);
            Intent intent = getIntent();
            Bundle bundle = getIntent().getExtras();
            show_name.setText(bundle.getString("name"));
            show_pass.setText(bundle.getString("password"));
            show_gender.setText(intent.getStringExtra("gender"));
            show_hobby.setText(intent.getStringExtra("hobbys"));
    
        }
    
        public void finish(){
    
        }
    }
  • 相关阅读:
    子类继承和调用父类的构造方法 (转)
    数组复制 System.arraycopy 与 Arrays.copyof()
    ArrayList的使用方法 (转)
    Eclipse 的debug 用法 (转)
    for each
    二维数组 排序 随机数 练习
    react 之 reflux 填坑
    react & vue 项目创建的方式
    数组实例的 copyWithin()
    es6的正则扩展笔记之修饰符
  • 原文地址:https://www.cnblogs.com/hzpiou/p/13897073.html
Copyright © 2011-2022 走看看