Android微信登录页面实现
利用Android实现微信手机端的登录页面,对于登录的输入做了一些的条件限制诸如,非空,长度限制等;
效果图如下:
xml文件代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"tools:context=".MainActivity"><TextViewandroid:id="@+id/nextx"android:layout_width="match_parent"android:layout_height="40dp"android:layout_marginBottom="20dp"android:paddingLeft="10dp"android:textSize="29sp" /><TextViewandroid:layout_width="match_parent"android:layout_height="50dp"android:layout_marginTop="10dp"android:paddingLeft="10dp"android:gravity="center"android:text="手机号登录"android:textSize="29sp" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="50dp"android:paddingTop="20dp"android:gravity="left"android:orientation="horizontal"><TextViewandroid:layout_width="100dp"android:layout_height="50dp"android:paddingLeft="10dp"android:text="国家/地区"android:textSize="18sp" /><TextViewandroid:layout_width="200dp"android:layout_height="50dp"android:paddingLeft="10dp"android:text="中国大陆(+86)"android:textColor="#11E811"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="58dp"android:layout_marginRight="8dp"android:layout_marginBottom="20dp"><TextViewandroid:layout_width="100dp"android:layout_height="match_parent"android:paddingLeft="10dp"android:layout_marginRight="10dp"android:paddingTop="15dp"android:text="手机号"android:textSize="18sp" /><EditTextandroid:id="@+id/phone"android:layout_width="310dp"android:layout_height="match_parent"android:paddingTop="8dp"android:hint="请输入手机号" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="58dp"android:layout_marginRight="8dp"android:layout_marginBottom="20dp"><TextViewandroid:layout_width="100dp"android:layout_height="match_parent"android:paddingLeft="10dp"android:layout_marginRight="10dp"android:paddingTop="15dp"android:text="密码"android:textSize="18sp" /><EditTextandroid:id="@+id/pwd"android:layout_width="310dp"android:layout_height="match_parent"android:paddingTop="8dp"android:inputType="textPassword"android:hint="请输入密码" /></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:paddingLeft="10dp"android:layout_marginBottom="10dp"android:text="用微信号/QQ号/邮箱登录"android:textSize="14sp" /><Buttonandroid:id="@+id/next"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginRight="10dp"android:background="#0FC814"android:paddingTop="10dp"android:paddingBottom="10dp"android:text="登录"android:textColor="#FFFFFF" /><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="400dp"android:gravity="center_horizontal"android:paddingTop="10dp"android:text="找回密码 | 紧急冻结 | 微信安全中心" /></LinearLayout>
java控制代码:
package com.d.jisuanqi;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;public class MainActivity extends AppCompatActivity {private EditText pwd,phone;private Button button;String account,password;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);pwd=findViewById(R.id.pwd);phone=findViewById(R.id.phone);button=findViewById(R.id.next);button.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {password=pwd.getText().toString();account=phone.getText().toString();if (password.equals("")||account.equals("")) {Toast.makeText(MainActivity.this, "请您将信息填写完整!", Toast.LENGTH_LONG).show();}else if(password.length()<6||account.length()<6){Toast.makeText(MainActivity.this, "密码和账号长度在6位及以上请检查", Toast.LENGTH_LONG).show();}else{Intent intent=new Intent();intent.setClass(MainActivity.this,Main2Activity.class);startActivity(intent);}}});}
}
Android微信登录页面实现相关推荐
- Android注册登录页面
Android注册登录页面 需求 分析 项目目录 .java domain JsonBean.java UserInfo.java utils GetJsonDataUtil.java Login.j ...
- Android微信登录在华为手机上无法调起授权界面的问题
Android微信登录在华为手机上无法调起授权界面的问题 App集成了微信登录,在其他手机上微信登录都可以正常调起微信授权页面,并且登录成功,但是 在华为手机上调用微信登录,没报异常,也无法调起微信授 ...
- android 微信登录与分享集成
android 微信登录与分享 android微信登录与分享这两个功能是很常用的,尤其是现在微信用户日益剧增,qq虽然很经典但是感觉大多数用来办公 每个写android的小伙伴估计都会写到这个功能,我 ...
- android 微信登录不回调,Anroid 进阶之旅 | 微信登录没有回调的问题
Android微信登录,分享后没有回调 (创建wxapi包的时候,一定要和开放平台填写的路径一致) Android实现微信第三方登录的情况非常多,今天在做微信登录的时候,始终无法回调WXEntryAc ...
- android 微信登录返回 -6
android 微信登录返回 -6 场景: 使用Android studio运行debug版程序,微信登录返回errocode = -6 .无法正常登录 原因: 网上查阅下:是签名与微信开放平台上注册 ...
- android微信登录的app签名 和 项目正式签名替换默认签名
之前微信登录的时候需要应用的签名,然后就直接用android studio自带的工具Build–>Generate Signed APK 获取了签名,给微信弄上就以为ok了,运行一下还是调不起微 ...
- Android 微信登录详细流程
流程讲解: 第一步:先去微信平台注册账号,填写应用信息,提交审核,大概需要三到五天的时间审核完成: 第二步:审核完成微信开放平台会生成一个appid,和sercet 这两个是唯一的id 需要妥善保管: ...
- Android 微信登录
/1.首先你得到微信.开放平台申请开发权限:https://open.weixin.qq.com/ 申请通过效果如下即可 2.其次,阅读开发文档: https://open.weixin.qq.com ...
- Android微信登录引起的内存泄漏
近日公司需求跟得不紧,就自己找事优化,重构,找内存泄漏(如有错误,烦请拍砖) 内存泄漏工具之前的写的博客也有介绍 内存泄漏检测工具很好用,下面用LeakCanary找一个微信登录引起的内存泄漏(其实微 ...
最新文章
- 人脸识别走光引热议!原来后台能看到的不只有脸,网友已社死,审核辣哭眼...
- 使用spinner 做下拉对话框
- Asp.Net上传组件
- 转到Servlet出现500型错误
- Python 数据科学手册 5.7 支持向量机
- Windows7无法访问(远程登录)Windows 2003共享问题解决
- VMware开启虚拟化实现CentOS创建KVM
- 电脑录音软件的技术原理
- RYYB图像格式学习
- 计算机网络(入门知识点最全整理)
- IE Adobe Flash Player版本已是最新,界面仍然提示版本过旧原因
- 【PR】PR剪辑视频片段并保存
- mybatis事务原理与集成spring的事务原理
- 脑与认知科学基础(期末复习)
- c语言程序长度单位换算表大全,小学数学单位换算公式大全(附专项训练)
- Ubuntu18.04配置运行Kintinuous
- python学习四十四天(前端之HTML标签)
- Vue3 - 组件通信(子传父)
- Python男票管理系统
- 比搞笑诺奖还离谱,看完国产AIGC最新创作,把我给整不会了
热门文章
- 对k210的初探—MixNo—颜色识别_识别采集图片中间框区域的颜色值
- 光大银行王磊:数据共享需重点防范第三方风险
- [计算机视觉]入门,光,RGB和HSV转换
- 中专计算机专业具体学习内容是什么?
- 手把手教你编写C++控制台小游戏 : 2048
- laravel7 学习(19)批量删除,软删除
- SharpMap学习:Map
- usaco Starry Night
- 对CAN/CAN-FD/ETH/Camera同步采集的数据采集工具软件
- 复变函数 | 第二部分 复变函数与解析函数