AndroidManifest.xml

layout1.xml

<?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="80dp"
android:layout_height="80dp"
android:src="@drawable/denglu"
android:onClick="wx1" />
</LinearLayout>

Layout1.java

package com.hanqi.application3;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout1 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout1); }
public void wx1(View view)
{
Intent intent = new Intent(this,Layout2.class);
startActivity(intent);
}
}

layout2.xml

<?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:padding="0dp"> <ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/tiaozhuan"
     android:scaleType="fitXY"
android:padding="0dp" /> 

</LinearLayout>

layout2.java

package com.hanqi.application3;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import java.util.Timer;
import java.util.TimerTask; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout2 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout2); final Intent it = new Intent(this,Layout3.class); //你要转向的Activity
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() { startActivity(it); //执行
}
}; timer.schedule(task, 1000 * 5); //5秒后 }
}

layout3.xml

<?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"> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/anniu001"
android:text="登陆"
android:onClick="wx2"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/anniu001"
android:text="注册"
android:onClick="wx3" /> </LinearLayout>

Layout3.java

package com.hanqi.application3;

import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout3 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout3);
}
public void wx2(View v)
{ //获取加载器
LayoutInflater layoutInflater = getLayoutInflater();
//加载layout文件
View vi_1 = layoutInflater.inflate(R.layout.layout5,null);
//添加按钮
new AlertDialog.Builder(this)
.setView(vi_1)
.setNegativeButton("取消", null)
.setPositiveButton("登陆", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { AlertDialog al = (AlertDialog) dialog; EditText pwd = (EditText) al.findViewById(R.id.et_pw); String str = pwd.getText().toString(); if (str.equals("123456")) {
Intent intent = new Intent(Layout3.this, Layout4.class);
startActivity(intent);
} else {
Toast.makeText(Layout3.this, "密码错误!", Toast.LENGTH_SHORT).show();
} }
})
.show();
}
public void wx3(View v)
{
final ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); pd.setMessage("请稍后");
pd.show(); //创建thread实例 重写run方法 启动多线程
new Thread()
{
@Override
public void run() {
super.run();
for (int i = 0;i<=pd.getMax();i++)
{
try {
Thread.sleep(100);
}catch (Exception e)
{}
pd.setProgress(i);
}
pd.dismiss();
}
}.start();
} }

layout4.xml

<?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="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/da4"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/da1"/> </LinearLayout>

Layout4.java

package com.hanqi.application3;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout4 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout4);
}
}

layout5.xml

<?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"> <ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/denglu"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="123456"
android:layout_gravity="center_horizontal"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="密码"
android:inputType="textPassword"
android:id="@+id/et_pw"/>
</LinearLayout>

---恢复内容结束---

AndroidManifest.xml

layout1.xml

<?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="80dp"
android:layout_height="80dp"
android:src="@drawable/denglu"
android:onClick="wx1" />
</LinearLayout>

Layout1.java

package com.hanqi.application3;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout1 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout1); }
public void wx1(View view)
{
Intent intent = new Intent(this,Layout2.class);
startActivity(intent);
}
}

layout2.xml

<?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:padding="0dp"> <ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/tiaozhuan" android:padding="0dp"
/> </LinearLayout>

layout2.java

package com.hanqi.application3;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import java.util.Timer;
import java.util.TimerTask; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout2 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout2); final Intent it = new Intent(this,Layout3.class); //你要转向的Activity
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() { startActivity(it); //执行
}
}; timer.schedule(task, 1000 * 5); //5秒后 }
}

layout3.xml

<?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"> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/anniu001"
android:text="登陆"
android:onClick="wx2"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/anniu001"
android:text="注册"
android:onClick="wx3" /> </LinearLayout>

Layout3.java

package com.hanqi.application3;

import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout3 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout3);
}
public void wx2(View v)
{ //获取加载器
LayoutInflater layoutInflater = getLayoutInflater();
//加载layout文件
View vi_1 = layoutInflater.inflate(R.layout.layout5,null);
//添加按钮
new AlertDialog.Builder(this)
.setView(vi_1)
.setNegativeButton("取消", null)
.setPositiveButton("登陆", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { AlertDialog al = (AlertDialog) dialog; EditText pwd = (EditText) al.findViewById(R.id.et_pw); String str = pwd.getText().toString(); if (str.equals("123456")) {
Intent intent = new Intent(Layout3.this, Layout4.class);
startActivity(intent);
} else {
Toast.makeText(Layout3.this, "密码错误!", Toast.LENGTH_SHORT).show();
} }
})
.show();
}
public void wx3(View v)
{
final ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); pd.setMessage("请稍后");
pd.show(); //创建thread实例 重写run方法 启动多线程
new Thread()
{
@Override
public void run() {
super.run();
for (int i = 0;i<=pd.getMax();i++)
{
try {
Thread.sleep(100);
}catch (Exception e)
{}
pd.setProgress(i);
}
pd.dismiss();
}
}.start();
} }

layout4.xml

<?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="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/da4"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/da1"/> </LinearLayout>

Layout4.java

package com.hanqi.application3;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; /**
* Created by Administrator on 2016/4/4.
*/
public class Layout4 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout4);
}
}

layout5.xml

<?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"> <ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/denglu"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="123456"
android:layout_gravity="center_horizontal"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="密码"
android:inputType="textPassword"
android:id="@+id/et_pw"/>
</LinearLayout>

andorid 练习微信登陆的更多相关文章

  1. Android调用微信登陆、分享、支付

    前言:用了微信sdk各种痛苦,感觉比qq sdk调用麻烦多了,回调过于麻烦,还必须要在指定包名下的actvity进行回调,所以我在这里写一篇博客,有这个需求的朋友可以借鉴一下,以后自己别的项目有用到也 ...

  2. 微信公众账号开发之微信登陆Oauth授权-第一篇

    我曾经在2012年的时候开始研究微信,那时微信的版本还是处于1.0,当时给朋友帮忙做一个基于微信端的web应用,官方的文档是相当少的,百度搜索出来的东西基本也没有多少实用价值,不过是在官网的基础上作了 ...

  3. 微信小程序之微信登陆 —— 微信小程序教程系列(20)

    简介: 微信登陆,在新建一个微信小程序Hello World项目的时候,就可以看到项目中出现了我们的微信头像,其实这个Hello World项目,就有一个简化版的微信登陆.只不过是,还没有写入到咱们自 ...

  4. 基于Flask 实现Web微信登陆

    网页版微信登陆网址 https://login.wx.qq.com/ 获取微信登陆的二维码 在浏览器中访问登陆接口 https://login.wx.qq.com/ 我们查找二维码的图片可以看到 其中 ...

  5. Python 爬虫五 进阶案例-web微信登陆与消息发送

    首先回顾下网页微信登陆的一般流程 1.打开浏览器输入网址 2.使用手机微信扫码登陆 3.进入用户界面 1.打开浏览器输入网址 首先打开浏览器输入web微信网址,并进行监控: https://wx.qq ...

  6. (https专业版)2018年1月5日高仿互站仿友价T5虚拟交易+实物交易商城-站长交易源码送手机版程序10套模版+首页微信登陆+头部下拉导航

    (https专业版)2018年1月5日高仿互站仿友价T5虚拟交易+实物交易商城-站长交易源码送手机版程序10套模版+首页微信登陆+头部下拉导航 首页支持微信登陆,只有第8套模板支持(endv模板),后 ...

  7. 微信登陆,微信SDK授权登陆经验分享

    From:http://www.eoeandroid.com/thread-547012-1-1.html 最近因为项目需要做了微信登陆,好像也是微信最近才放出来的接口.还需要申请才能有权限实现授权. ...

  8. 微信小程序:微信登陆(ThinkPHP作后台)

      https://www.jianshu.com/p/340b1ba5245e QQ截图20170320170136.png 微信小程序官方给了十分详细的登陆时序图,当然为了安全着想,应该加上签名加 ...

  9. 2017年11月8日最新仿互站导航t5友价商城-9套模板首页都增加微信登陆

    今天测试效果如下,直接看图吧,入口在下方,点击图片直达 把9套餐模板都添加了微信首页登陆,仿互站的导航,操作比互站还要方便,官方一直对https 支持不太友好,索性把所有的https bug都修复了, ...

随机推荐

  1. Signing Your Applications(Android签名相关)

    In this document Signing Overview Signing in Debug Mode Signing in Release Mode Signing Android Wear ...

  2. Python之路 - 网络编程初识

    Python之路 - 网络编程初识 前言

  3. hadoop-2.7.3完全分布式部署

    一.环境介绍      IP       host JDK linux版本 hadop版本 192.168.0.1 master 1.8.0_111 centos7.2.1511 hadoop-2.7 ...

  4. Jupter 7个进阶功能

    1.  执行shell命令 Shell是一种与计算机进行文本交互的方式. 一般来讲,当你正在使用Python编译器,需要用到命令行工具的时候,要在shell和IDLE之间进行切换. 但是,如果你用的是 ...

  5. 实例的render方法渲染组件

    1.普通渲染组件 在app容器中插入login组件 <login></login>  一个app可以多个这种组件 <script> var login = { te ...

  6. Java进阶 线程安全

    多线程编程中的三个核心概念 原子性 这一点,跟数据库事务的原子性概念差不多,即一个操作(有可能包含有多个子操作)要么全部执行(生效),要么全部都不执行(都不生效). 关于原子性,一个非常经典的例子就是 ...

  7. Bootstrap 轮播

    [Bootstrap 轮播] 1.要设置一个轮播界面,需要注意以下几点: 1)根div 必须为 class="carousel slide" 2)根div下含有三块子div a)& ...

  8. IN_ORDER_PLANNING、IN_BOM_CHANGE

    一.IN_ORDER_PLANNING 新增一个IN表(IN_ORDER_PLANNING,把ZFP037和ZFP026整合成一张表,标示哪些订单的是真验货/假验货.VIP真验货/假验货订单) ORD ...

  9. java.net.UnknownHostException: www.terracotta.org

    异常日志: java.net.UnknownHostException: www.terracotta.org at java.net.PlainSocketImpl.connect(PlainSoc ...

  10. Ext.require 的作用(转)

    Ext.require:用到哪些组件,然后就预先加载,多余不用加载的组件 在实际环境中我们都会用 ext-all.js, 但是在开发调试的时候,我们使用 require 的话它可以动态加载单个的 js ...