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. 在使用 #import <objc/message.h>时 xcode 报 :Too many arguments to function call, expected 0 , have * 解决方法

    选中项目 - Project - Build Settings - 

  2. Generative Adversarial Networks,gan论文的畅想

    前天看完Generative Adversarial Networks的论文,不知道有什么用处,总想着机器生成的数据会有机器的局限性,所以百度看了一些别人 的看法和观点,可能我是机器学习小白吧,看完之 ...

  3. String intern 方法 jdk中的描述

    一个初始为空的字符串池,它由类 String 私有地维护. 当调用 intern 方法时,如果池已经包含一个等于此 String 对象的字符串(用 equals(Object) 方法确定),则返回池中 ...

  4. 多线程 ThreadLocal

    要了解ThreadLocal,首先搞清楚ThreadLocal 是什么?是用来解决什么问题的? ThreadLocal 是线程的局部变量, 是每一个线程所单独持有的,其他线程不能对其进行访问, 通常是 ...

  5. spring-boot-devtools Idea 热部署

    1 pom.xml文件 注:热部署功能spring-boot-1.3开始有的 <!--添加依赖--> <dependency> <groupId>org.sprin ...

  6. Netty 能做什么

    作为一个学Java的,如果没有研究过Netty,那么你对Java语言的使用和理解仅仅停留在表面水平,会点SSH,写几个MVC,访问数据库和缓存,这些只是初等Java程序员干的事.如果你要进阶,想了解J ...

  7. Android 7.0解决抓取不到https请求的问题

    问题:Android7.0系统,使用fiddler不能抓取https请求 解决方法:  1.在源码res目录下新建xml目录,增加network_security_config.xml文件 (工程名/ ...

  8. TCP的状态转移

    状态转移图 状态分析 客户端 CLOSED 初始状态 调用connect将发起主动打开,发送SYN J到服务端,进入SYN_SENT状态. SYN_SENT 客户端已经发送SYN报文 接收到服务端发回 ...

  9. GreenDao在列中的单词之间自动加_

    1.第一种情况,原字段(属性.列)是 驼峰式命名法 @Entitypublic class Employee { @Id(autoincrement = true) private Long id; ...

  10. 在Plesk安装PHP的Memcached扩展

    默认情况下,Plesk的PHP没有Memcached扩展,需要自己安装. Plesk-without-memcached,在Plesk下安装PHP Memcached扩展 PHP Memcache是​ ...