首页 > 其他分享 >每日总结2023-04-09

每日总结2023-04-09

时间:2023-04-09 20:56:01浏览次数:31  
标签:Toast widget pas 04 main2 09 2023 import android

今天完成了密码找回界面

代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@mipmap/qw"
    android:orientation="vertical"
    tools:context=".retrieve_Activity">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scaleType="fitStart"
        android:src="@mipmap/top" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="150dp"
        android:layout_marginRight="30dp"
        android:background="@drawable/background_res"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/name" />

            <EditText
                android:id="@+id/main2_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:layout_marginLeft="10dp"
                android:background="@null"
                android:hint="手机号/邮箱"
                android:imeOptions="actionSearch"
                android:maxLength="10"
                android:maxLines="1"
                android:singleLine="true"
                tools:ignore="TouchTargetSizeCheck" />

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="2px"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="20dp"
            android:background="#f3f3f3" />


    </LinearLayout>

    <Button
        android:id="@+id/main2_res"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="50dp"
        android:layout_marginTop="340dp"
        android:layout_marginRight="50dp"
        android:background="@drawable/button_1"
        android:onClick="find_pas"
        android:text="找回" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="420dp"
        android:layout_marginRight="30dp"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/password" />

            <TextView
                android:id="@+id/main2_password"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="30dp"
                android:text="密码为" />

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="2px"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="20dp"
            android:background="#f3f3f3" />

    </LinearLayout>
</RelativeLayout>

Java文件为

package com.example.math;
/*
* 找回界面*/
import static android.widget.Toast.LENGTH_SHORT;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.example.math.repositiory.user_res;

public class retrieve_Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_retrieve);
    }

    public void find_pas(View view) {
        EditText main2_name = findViewById(R.id.main2_name);
        TextView main2_pas = findViewById(R.id.main2_password);
        Handler handler = new Handler();

        new Thread() {

            @Override
            public void run() {
                String pas;
                try {
                    pas = user_res.findPassword(main2_name.getText().toString());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                handler.post(() -> main2_pas.setText(pas));
            }
        }.start();
        Toast.makeText(getApplicationContext(), "找回成功", Toast.LENGTH_LONG).show();
    }
}

 

标签:Toast,widget,pas,04,main2,09,2023,import,android
From: https://www.cnblogs.com/JJTyyds/p/17301025.html

相关文章

  • 2023第14届蓝桥杯C/C++A组参赛记录+部分题解
    比赛记录早上起得还算早,没吃早餐,我吃早餐会瞌睡,也会变蠢。在门口还没来得及和队里其他同学聊几句就进场了......键盘还是一样的难用,软件有codeblocks和dev,很舒服。今年来参加蓝桥杯的人好多啊......女生也好多。听说今年蓝桥杯有统一的正经培训,不过和我这个被踢出蓝桥杯群的......
  • 【230409-1】记者要为5名志愿者和他们帮助的2位老人拍照,要求排成一排,2位老人相邻但不
    ......
  • 【 2023 】近期一些编译调试开发 Android7&9 系统的笔记( h616 / imx8m / rk3399 )
    主要就记录一下自己食用过程中遇到的一些问题吧,板子有新有旧,但都差不多。待整理呢。https://stackoverflow.com/questions/67363030/rebuild-android-code-with-error-ssl-error-when-connecting-to-the-jack-server-thttps://note.qidong.name/2017/07/disable-jack-server/......
  • NOI / 1.8编程基础之多维数组 04:错误探测
    描述给定n*n由0和1组成的矩阵,如果矩阵的每一行和每一列的1的数量都是偶数,则认为符合条件。你的任务就是检测矩阵是否符合条件,或者在仅改变一个矩阵元素的情况下能否符合条件。"改变矩阵元素"的操作定义为0变成1或者1变成0。输入输入n+1行,第1行为矩阵的大小n(0<n<100),以......
  • 230409 What is a Battery Management System
    WelcometotheStoffelSystemsInsightsvideoseries.I'mEricStoffel,PresidentofStoffelSystems.Inthisseries,we'lldiscussbatterymanagementsystemsasusedinlithium-ionbatterypacks.Let'sbeginwithanintroductiontowhatabat......
  • 2023 中国IC设计100 排行榜!
    Top10上市公司Top10EDA/IP公司Top10MCU公司Top10电源管理芯片(PMIC)公司Top10AI芯片公司Top10无线连接(WiFi/BT/NB-IoT/LoRa/UWB)芯片公司Top10处理器(CPU/GPU/FPGA/ASIC)芯片公司Top10模拟芯片公司Top10功率器件公司Top10传感器/MEMS公司Top10存......
  • 【Voyage】GDOI 2023 旅游记 || ECHO.
    \(\color{#FFFFFF}{那是什么样的旅途呢}\)\(\color{#FFFFFF}{真的会害怕很多东西呢。想想害怕的其实不止这样一件事,便产生了“其实都一样没关系的,都应该踏过去的”这样的想法}\)\(\color{#FFFFFF}{——3月29日}\)注:这个真的是旅游记。作个人纪念。会配上一些图片完整相册等......
  • 2023年4月9日
    执行学习复习数据库相关部分,数据库设计是重点要讲清楚你这个系统,功能模块功能模块有一条他说,新增的用户除了删除其他的权限都有,这里找见,搞明白,修改一下,修改成可以定义的,就是选择了什么角色,他只能干什么,比如项目经理,他只可以创建项目,没有权限创建接口GPT一个项目中如何确......
  • Ubuntu22.04办公环境初始设置记录
    1前言这周末刚从Windows办公环境切换到Ubuntu22.04,有些东西还是比较折腾,记录一下便于以后查找。2.安装时的分区设置从一块完整的新硬盘安装Ubuntu单系统时,只需要以下分区:ESP分区(EFISystemPartition),设为200MB即可,是GPT分区表存储的位置。UEFI引导的系统都需要这个分区。......
  • JavaWeb-24课-filter-2023-04-09
    Servlet类,没有乱码处理packagecom.feijian.servlet;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importjava.io.IOException;public......