zoukankan      html  css  js  c++  java
  • QQ登陆模拟练习

    第一视图窗口

    <?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">
    
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/beijing"/>
    
    </LinearLayout>

    实现代码——延时跳转

    package com.hanqi.lianxi;
    
    import android.content.Intent;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    
    import java.util.Timer;
    import java.util.TimerTask;
    
    public class qqActivity2 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.layout_qq2);
    
            final Intent localIntent = new Intent(this,qqActivity.class);
            Timer Timer = new Timer();
            TimerTask tast = new TimerTask() {
                @Override
                public void run()
                {
                    startActivity(localIntent);
                }
            };
    
            Timer.schedule(tast,4000);
        }
    }

    实现效果图:

    第二视图窗口

    <?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: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="com.hanqi.lianxi.qqActivity"
        android:orientation="vertical"
        android:weightSum="1">
    
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/qq2"/>
    
        <Spinner
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:id="@+id/sp_1"
            android:singleLine="true"
            ></Spinner>
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:hint="密码"
            android:textSize="15dp"
            android:password="true"
            android:singleLine="true"
            />
    
        <Button
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="登录"
            android:background="@drawable/lanse"
            android:layout_marginTop="20dp"
            android:textSize="10pt"
            android:id="@+id/dl"
            android:onClick="bl_OnClick"/>
    
    </LinearLayout>
    <?xml version="1.0" encoding="utf-8"?>
    <EditText xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:textSize="15dp"
        android:hint="账号"
        android:numeric="integer">
    
    </EditText>

    实现代码

    package com.hanqi.lianxi;
    
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.ArrayAdapter;
    import android.widget.Spinner;
    import android.widget.Toast;
    
    public class qqActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_qq);
    
    
    
            String[] strings = {"728664121","1132143009","1186364571","1847593021","92718287187",};
    
            ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,R.layout.layout_qq,strings);
    
    
            Spinner sp_1 = (Spinner)findViewById(R.id.sp_1);
    
            sp_1.setAdapter(arrayAdapter);
    
            sp_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
    
    
                }
    
                @Override
                public void onNothingSelected(AdapterView<?> parent) {
    
                    Toast.makeText(qqActivity.this, "账号不能为空", Toast.LENGTH_SHORT).show();
                }
            });
    
    
        }
        public void bl_OnClick(View v)
        {
            Intent intent = new Intent(this,qqActivity3.class);
    
            startActivity(intent);
    
            Toast.makeText(qqActivity.this, "登陆成功,请稍后……", Toast.LENGTH_SHORT).show();
        }
    }

    实现效果:

    第三视图窗口

    <?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">
    
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/img"/>
    
    </LinearLayout>

    实现代码

    package com.hanqi.lianxi;
    
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    
    import java.util.Timer;
    import java.util.TimerTask;
    
    public class qqActivity3 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_qq3);
    
    
            Timer Timer = new Timer();
            TimerTask tast = new TimerTask() {
                @Override
                public void run()
                {
    
                }
            };
        }
    }

    实现效果图

  • 相关阅读:
    【ACM】nyoj_139_我排第几个_201308062046
    【ACM】poj_2356_Find a multiple_201308061947
    【ACM】hdu_zs2_1007_Problem G _201308031028
    【ACM】hdu_zs2_1006_Problem F_201308031058
    【ACM】hdu_zs2_1005_Problem E _201308030747
    【ACM】hdu_zs2_1004_Problem D _201308030856
    【葡萄城报表案例分享】项目施工进度报告 – 树形报表
    【葡萄城报表案例分享】电力设备生产数据的多层分组统计报表实现
    葡萄城报表之多维透视表 – 矩表实现商品销售对比统计
    葡萄城报表之矩表 – 现代数据分析中必不可少的报表工具
  • 原文地址:https://www.cnblogs.com/fangchongyan/p/5375239.html
Copyright © 2011-2022 走看看