摘要: 一,安装第三方库: 地址: https://mvnrepository.com/artifact/com.google.code.gson/gson build.gradle中dependencies添加: implementation 'com.google.code.gson:gson:2.13 阅读全文
posted @ 2025-05-10 09:06 刘宏缔的架构森林 阅读(27) 评论(0) 推荐(0)
摘要: 一,代码: xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/ 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(34) 评论(0) 推荐(0)
摘要: 一,代码: xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(79) 评论(0) 推荐(0)
摘要: 一,代码: xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(40) 评论(0) 推荐(0)
摘要: 一,代码: gson库安装方式见我其他博文 传递对象的类: package com.example.okdemo1.model; public class Goods1 { //商品id private int id; //商品名称 private String name; public Goods 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(10) 评论(0) 推荐(0)
摘要: 一,代码: 1,用来传递对象的类 package com.example.okdemo1.model; import java.io.Serializable; public class Goods2 implements Serializable { //商品id private int id; 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(17) 评论(0) 推荐(0)
摘要: 一,代码: 1,所传递对象的类 package com.example.okdemo1.model; import android.os.Parcel; import android.os.Parcelable; public class Goods3 implements Parcelable { 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(22) 评论(0) 推荐(0)
摘要: 一,官方文档 https://developer.android.google.cn/studio/debug?authuser=1&hl=zh-cn 二,启动调试 1,点击工具栏上按钮,启动调试 2,对运行的进程进行调试: 点击工具栏上的Attach debugger to Android pro 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(76) 评论(0) 推荐(0)
摘要: 一,官方文档: https://developer.android.google.cn/guide/components/activities/activity-lifecycle?hl=zh-cn 官方对生命周期的说明图 二,代码: package com.example.okdemo1; imp 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(96) 评论(0) 推荐(0)
摘要: 一,代码: xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res 阅读全文
posted @ 2025-05-10 09:05 刘宏缔的架构森林 阅读(13) 评论(0) 推荐(0)
摘要: 一,两种方式: ViewTreeObserver.OnGlobalLayoutListener 可以监听视图树的全局布局事件,当视图树的布局发生变化时会触发回调。通过这种方式可以在视图布局完成后获取其宽高。 View.post 方法可以将一个 Runnable 放入视图的消息队列中,当视图布局完成后 阅读全文
posted @ 2025-05-10 09:04 刘宏缔的架构森林 阅读(28) 评论(0) 推荐(0)
摘要: 一,只隐藏状态栏 在onCreate事件中,setContentView前添加 //只隐藏状态栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 效果: 二,同时隐藏状态栏和导航栏 在onCreate事件中,setC 阅读全文
posted @ 2025-05-10 09:04 刘宏缔的架构森林 阅读(206) 评论(0) 推荐(0)
摘要: 一,代码: public class FrameActivity extends AppCompatActivity { private View pushView; private int deOptions; //系统可见性的选项 private View decorView; @Overrid 阅读全文
posted @ 2025-05-10 09:04 刘宏缔的架构森林 阅读(62) 评论(0) 推荐(0)
摘要: 一,代码: package com.example.okdemo1.activity; import static android.app.PendingIntent.getActivity; import android.animation.Animator; import android.ani 阅读全文
posted @ 2025-05-10 09:04 刘宏缔的架构森林 阅读(121) 评论(0) 推荐(0)
摘要: 一,类代码: package com.example.okdemo1.lib; import android.util.Log; public class Logger { /* public static final int VERBOSE = 2; public static final int 阅读全文
posted @ 2025-05-10 09:04 刘宏缔的架构森林 阅读(25) 评论(0) 推荐(0)
摘要: 一,代码: 说明:要使用layui的lay-filter html: <div class="layui-form layui-col-md6" style="margin-left: 6px;width:130px;margin-top:16px;"> <select name="type" id 阅读全文
posted @ 2025-05-10 09:02 刘宏缔的架构森林 阅读(97) 评论(0) 推荐(0)
摘要: 一,代码: //给按钮增加点击事件 Button button2 = findViewById(R.id.button2); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(V 阅读全文
posted @ 2025-05-10 09:02 刘宏缔的架构森林 阅读(19) 评论(0) 推荐(0)
摘要: 一,代码: xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match 阅读全文
posted @ 2025-05-10 09:02 刘宏缔的架构森林 阅读(8) 评论(0) 推荐(0)
摘要: 一,报错信息: Caused by: android.content.res.Resources$NotFoundException: Drawable (missing name) with resource ID #0x7f050224 Caused by: android.content.re 阅读全文
posted @ 2025-05-10 09:02 刘宏缔的架构森林 阅读(167) 评论(0) 推荐(0)
摘要: 一,代码: xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="300dp" 阅读全文
posted @ 2025-05-10 09:02 刘宏缔的架构森林 阅读(11) 评论(0) 推荐(0)