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

每日总结2023-05-05

时间:2023-05-05 19:00:09浏览次数:40  
标签:总结 WaitingActivity 05 void 2023 import android onCreate

Android加载界面

 

 

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    tools:context="com.toprs.waitingpractice.MainActivity">

    <Button
        android:text="登录"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="loginClick"
        android:id="@+id/button2"/>
</LinearLayout>

 

 

MainActivity.java

package com.toprs.waitingpractice;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

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

    public void loginClick(View v){
        Intent intent = new Intent();
        intent.setClass(MainActivity.this,WaitingActivity.class);
        startActivity(intent);
    }
}

 

 

waiting_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    tools:context="com.toprs.waitingpractice.MainActivity">

    <Button
        android:text="登录"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="loginClick"
        android:id="@+id/button2"/>
</LinearLayout>

WaitingActivity.java

package com.tow.waitingpractice;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.Toast;

/**
 * Created by 39867 on 2017/4/18.
 */

public class WaitingActivity extends Activity {

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

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                WaitingActivity.this.finish();
                Toast.makeText(WaitingActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
            }
        },2000);
    }
}

 

标签:总结,WaitingActivity,05,void,2023,import,android,onCreate
From: https://www.cnblogs.com/JJTyyds/p/17375116.html

相关文章

  • 信奥赛题1105:数组逆序重存放
    新奥赛一本通,题11051105:数组逆序重存放时间限制:1000ms         内存限制:65536KB提交数:70600                通过数:47540【题目描述】将一个数组中的值按逆序重新存放。例如,原来的顺序为8,6,5,4,1。要求改为1,4,5,6,8。【输入】两行:第......
  • RestHighLevelClient 使用总结
    .index接口--新增/更新索引,内容更新是覆盖式的.update接口--更新索引,支持局部字段的更新,相对.index接口相比,减少了没有必要的字段更新 相关文档:https://zhuanlan.zhihu.com/p/551414799......
  • c++-2023-05-05
    1、什么是标识符?变量、常量。为什么给标识符命名时要求开头不能使用数字?假如定义成int1=1,将造成混乱。2、为什么要有数据类型?为了方便分配内存。3、在vs的c++编译器中,如果定义单精度变量时其初始值后没有加f,系统会默认为double类型。4、c++中字符串的定义stringstr="hello......
  • [Leetcode] 0705. 设计哈希集合
    705.设计哈希集合EnglishVersion题目描述不使用任何内建的哈希表库设计一个哈希集合(HashSet)。实现MyHashSet类:voidadd(key)向哈希集合中插入值key。boolcontains(key)返回哈希集合中是否存在这个值key。voidremove(key)将给定值key从哈希集合中删除。如果......
  • Prometheus-Operator使用ServiceMonitor监控配置时遇坑与解决总结
    摘要本文范围:Prometheus-Operator&kube-prometheus安装;以及在解决使用ServiceMonitor时遇到的坑。PrometheusOperator简介随着云原生概念盛行,对于容器、服务、节点以及集群的监控变得越来越重要。Prometheus作为Kubernetes监控的事实标准,有着强大的功能和良好的生态......
  • Java8之UnaryOperator总结
    在Java8中,UnaryOperator是一个参数接口,它继承自Function,UnaryOperator接收一个参数,返回和参数同样类型的结果,其实相当于对数据做了加工。@FunctionalInterfacepublicinterfaceUnaryOperator<T>extendsFunction<T,T>{}UnaryOperator作为参数importjava.util.Array......
  • Wpf Datagrid 操作总结
    1.行选中时,.SelectedIndex可以获取行索引2.单元格选中时,获取行索引可以用以下(Grid为DataGrid的对象)DataGridCellInfoselectedCell=Grid.SelectedCells.FirstOrDefault();//没有选中Recordif(selectedCell==null||selectedCell.Column==null)return;intinde......
  • 2023年母亲节是哪一天?用手机提醒自己
    进入2023年的公历5月份,告别五一小长假之后,我们又要迎来一个非常有意义的节日了,这就是母亲节。那么今年的母亲节是哪一天呢?每年的母亲节都是公历5月份的第二个星期日,所以今年的母亲节是5月14日。为了表达对母亲的感恩之情,世界各地的人都会在这一天向母亲送上鲜花和礼物,例如漂亮的......
  • 【剑指 Offer】 05. 替换空格
    【题目】请实现一个函数,把字符串s中的每个空格替换成"%20"。 示例1:输入:s="Wearehappy."输出:"We%20are%20happy." 限制:0<=s的长度<=10000来源:力扣(LeetCode)链接:https://leetcode.cn/problems/ti-huan-kong-ge-lcof【思路】用StringBuilder,遍历数组,遇到空格就追加%20......
  • 创新引领未来|经纬恒润2023年新产品发布会
        近日,经纬恒润对外发布了2023新产品系列家族:    ·电气化黑科技-电动增压器eBooster;    · 汽车域控新架构必备神器-中央计算平台和物理区域控制单元;    · 颠覆你认知的AR-HUD;    · 提升智驾竞争力法宝-行泊一体产品家族;  ......