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. ArcGIS案例学习笔记4_2_水文分析批处理地理建模

    ArcGIS案例学习笔记4_2_水文分析批处理地理建模 联系方式:谢老师,135_4855_4328,xiexiaokui#139.com 概述 计划时间:第4天下午 目的:自动化,批量化,批处理,提 ...

  2. web自动化测试中接口测试学习笔记

    一.web基础 web是实现:客户端浏览器端<—————>服务端  交互的应用: web通常包含两部分:web客户端.web服务端:web客户端技术包含html.javascript.aj ...

  3. C# 13位时间戳转换成标准时间C#代码

    原地址:https://www.cnblogs.com/yixuehan/p/5559244.html /// <summary> /// 时间戳转换成标准时间 /// </summ ...

  4. 吴裕雄 python深度学习与实践(3)

    import threading, time def doWaiting(): print('start waiting:', time.strftime('%S')) time.sleep(3) p ...

  5. redis集群实战

    一.说明 redis 3.0集群功能出来已经有一段时间了,目前最新稳定版是3.0.5,我了解到已经有很多互联网公司在生产环境使用,比如唯品会.美团等等,刚好公司有个新项目,预估的量单机redis无法满 ...

  6. cmd从新获取ip

    1.ipconfig/release 2.ipconfig/renew

  7. idea 热部署之JRebel安装-激活-简单使用(修改方法\配置文件均生效)

    1.简介 JRebel插件在IntelliJ IDEA中用于代码的热部署,即工程在已经启动的状态下修改代码,可以不用再重启服务,JRebel插件会自动帮我们编译代码,然后重启.整个重启的过程耗时非常短 ...

  8. Link & Redirect

    [Link] Link标签,用于实现React-Router功能的跳转.(意思是就不要使用a标签了) 1)to:string,指明要跳转的path. import { Link } from 'rea ...

  9. display:none vs visibility:hidden

    [display:none vs visibility:hidden] 设置元素的display为none是最常用的隐藏元素的方法. 1 .hide { 2 display:none; 3 } 将元素 ...

  10. python+selenium的环境配置

    以前写过关于python和selenium加myeclipse的环境配置,但是myeclipse启动时过于费时,虽然myeclipse有很好的提示功能,但是作为初学者,我还是直接用python的idl ...