自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

转载 ImageButton的妙处

图片按钮,用ImageButton,妙哇

2022-08-06 01:09:32 141

原创 使用SharedPreference实现用户登录(二 .java的实现)

一、主界面的实现import androidx.appcompat.app.AppCompatActivity;import android.annotation.SuppressLint;import android.content.Intent;import android.content.SharedPreferences;import android.os.Bundle;import android.view.View;import android.widget.Button;.

2022-05-12 23:15:17 890

原创 使用SharedPreferences实现用户登录(一、页面布局)

实现用户登录注册

2022-05-09 18:49:08 937

原创 Android Studio躲避小球小游戏(一界面布局)

一、开始游戏界面(activity_main.xml)<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background

2022-05-03 22:29:00 2555 2

原创 创建对象方法newInstance

通过反射创建新的类示例,有两种方式: Class.newInstance() 以及Constructor.newInstance()。其中,在Android开发和Java中工厂模式中比较常用的是newInstance();1、 Class.newInstance() 只能够调用无参的构造函数,即默认的构造函数;Class.newInstance()并且要求被调用的构造函数是可见的,也即必须是public类型的; 使用newInstance()方法的时候,就必须保证:1)这个类已经加载;2)这个类已经连接

2022-05-02 23:51:28 1208

转载 Java调用类方法

一、调用的是静态类可以用类名直接调用,调用格式:类名.方法名(参数表)public class StaticCall { public static void staticCall(){ System.out.println("Successfully called the method in the static class"); }}public class Main { public static void main(String[] args) {...

2022-05-02 23:34:47 6232

转载 实现数据保存、SharedPreferences、Context的整理资料

一、getSharedPreferences()和getPreferences()方法Context类中的getSharedPreferences ( ) 方法 此方法有2个参数,getSharedPreferences(name,mode):第一个参数(name)用于指定 SharedPreferences 文件的名称,若指定的文件不存在则创建一个;第二个参数(mode)用于指定操作模式,默认操作模式为MODE_PRIVATE,Android 6.0以上只有这一种模式可选。Act...

2022-05-02 23:32:18 447

转载 Activity的生命周期

一、通过Intent跳转Activity1、假设目前已经程序中有2个Activity,分别叫做FirstActivity,SecondActivity,现在想在FirstActivity中跳转至SecondActivity,但同时保留FirstActivity,即跳转至SecondActivity后按下返回键仍可回到FirstActivity。Intent intent = new Intent(FirstActivity.this,secondActivity.class);startActiv

2022-05-02 23:31:15 93

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除