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. spark pyspark 常用算法实现

    利用Spark-mllab进行聚类,分类,回归分析的代码实现(python) http://www.cnblogs.com/adienhsuan/p/5654481.html 稀疏向量: 关于Spar ...

  2. mysql 触发器介绍

    create trigger triggerName   after/before insert/update/delete on tableName  for each row   --这句话在my ...

  3. KADEMLIA算法学习

    在上一篇文章中<P2P技术是什么>,我们介绍了P2P技术的特点以及发展历史.在本篇文章中,我们来介绍某一个具体的算法. 如今很多P2P网络的实现都采用DHT的方式实现查找,其中Kademl ...

  4. python scrapy 插入数据库的操作

    需要安装这个 pymysql 写法还是很简单的 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget t ...

  5. apt-get出现的问题

    报的错 E: 无法获得锁 /var/cache/apt/archives/lock – open (11 资源临时不可用) E: 无法锁定下载目录 解决方法一: #:ps -aux (列出进程,形式如 ...

  6. python 自然语言处理库https://www.nltk.org/nltk_data/

    https://www.nltk.org/nltk_data/ https://github.com/hankcs/HanLP

  7. 解题6(OutputNMin)

    题目描述 输入n个整数,输出其中最小的k个. 详细描述: 接口说明 原型: bool GetMinK(unsignedint uiInputNum, int * pInputArray, unsign ...

  8. PHP 在 Mac 的安装之路

    半年前本以为有一些 Apache 和 PHP 的安装经验,今天在 Mac 上还是踩了很多坑. 坦诚地讲,这东西入门成本比 Node,Python 入门成本真的是大很多. Apache 的编译安装就是那 ...

  9. Forms.WebBrowser与Controls.WebBrowser区别

    Forms.WebBrowser与Controls.WebBrowser区别 Forms.WebBrowser有ScrollBarsEnabled 属性,即窗口滚动条,可以设置为false即可: Co ...

  10. HTTP/1.1新建会话失败 解决方法及分析

    右键我的电脑—>属性—>点击高级项卡—>设置性能,在性能选项中选择高级选项卡,在虚拟内存处显示“所有驱动器文件大小的总数:0M”,原来问题出在这里,由于操作系统的分页内存太小,而引起 ...