andorid 练习微信登陆






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>
---恢复内容结束---
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 练习微信登陆的更多相关文章
- Android调用微信登陆、分享、支付
前言:用了微信sdk各种痛苦,感觉比qq sdk调用麻烦多了,回调过于麻烦,还必须要在指定包名下的actvity进行回调,所以我在这里写一篇博客,有这个需求的朋友可以借鉴一下,以后自己别的项目有用到也 ...
- 微信公众账号开发之微信登陆Oauth授权-第一篇
我曾经在2012年的时候开始研究微信,那时微信的版本还是处于1.0,当时给朋友帮忙做一个基于微信端的web应用,官方的文档是相当少的,百度搜索出来的东西基本也没有多少实用价值,不过是在官网的基础上作了 ...
- 微信小程序之微信登陆 —— 微信小程序教程系列(20)
简介: 微信登陆,在新建一个微信小程序Hello World项目的时候,就可以看到项目中出现了我们的微信头像,其实这个Hello World项目,就有一个简化版的微信登陆.只不过是,还没有写入到咱们自 ...
- 基于Flask 实现Web微信登陆
网页版微信登陆网址 https://login.wx.qq.com/ 获取微信登陆的二维码 在浏览器中访问登陆接口 https://login.wx.qq.com/ 我们查找二维码的图片可以看到 其中 ...
- Python 爬虫五 进阶案例-web微信登陆与消息发送
首先回顾下网页微信登陆的一般流程 1.打开浏览器输入网址 2.使用手机微信扫码登陆 3.进入用户界面 1.打开浏览器输入网址 首先打开浏览器输入web微信网址,并进行监控: https://wx.qq ...
- (https专业版)2018年1月5日高仿互站仿友价T5虚拟交易+实物交易商城-站长交易源码送手机版程序10套模版+首页微信登陆+头部下拉导航
(https专业版)2018年1月5日高仿互站仿友价T5虚拟交易+实物交易商城-站长交易源码送手机版程序10套模版+首页微信登陆+头部下拉导航 首页支持微信登陆,只有第8套模板支持(endv模板),后 ...
- 微信登陆,微信SDK授权登陆经验分享
From:http://www.eoeandroid.com/thread-547012-1-1.html 最近因为项目需要做了微信登陆,好像也是微信最近才放出来的接口.还需要申请才能有权限实现授权. ...
- 微信小程序:微信登陆(ThinkPHP作后台)
https://www.jianshu.com/p/340b1ba5245e QQ截图20170320170136.png 微信小程序官方给了十分详细的登陆时序图,当然为了安全着想,应该加上签名加 ...
- 2017年11月8日最新仿互站导航t5友价商城-9套模板首页都增加微信登陆
今天测试效果如下,直接看图吧,入口在下方,点击图片直达 把9套餐模板都添加了微信首页登陆,仿互站的导航,操作比互站还要方便,官方一直对https 支持不太友好,索性把所有的https bug都修复了, ...
随机推荐
- C# 图像处理:记录图像处理时间的一个类
class HiPerTimer { [DllImport("user32.dll")] static extern bool GetLastInputInfo(ref LASTI ...
- C# 汉字转拼音(全拼)
C# 汉字转拼音(全拼) 很多时候我们需要把汉字转换成拼音,比如姓名.城市名等.网上搜索了一把,把汉字转成拼音的代码很多,但大多都只是把汉字转成了拼音的首字母,比如把“深圳”转成了“sz”.那 ...
- 吴裕雄 oracle PL/SQL编程
- 学JS的心路历程 -数组常见处理方法
昨天我们有提到说for-of和forEach可以用来处理数组,但其实还有很多方法可以更快速及精简代码的达到你要的效果. 话不多说,我们赶紧来看吧! Array.prototype.map() 会回传一 ...
- linux下进程查找和杀死
比如杀死进程中叫 abc的进程 1.ps -ef |grep abc|awk '{print $2}' xargs kill -9 2.kill `pidof abc` `位于tab键 ...
- ChromDevTools
[ChromDevTools] 1.如何打开DevTools. 在Chrome菜单中选择 更多工具 > 开发者工具 在页面元素上右键点击,选择 “检查” 使用 快捷键 F12 2.切换 Devi ...
- Manifest File
[Manifest File] on every build, webpack generates some webpack runtime code, which helps webpack do ...
- jms学习笔记
https://www.cnblogs.com/zhuxiaojie/p/5564187.html //创建一个session //第一个参数:是否支持事务,如果为true,则会忽略第二个参数,被jm ...
- 一分钟了解Android横竖屏 mdpi hdpi xhdpi xxhdpi xxxhdpi (转)
转自:http://blog.csdn.net/a704755096/article/details/46342689 DPI:每英寸像素数 简单的屏幕分辨率计算方法: DisplayMetrics ...
- jdk各版本名称