摘要:
一,原因: Android P全面禁止了非https链接,并严格审查网站的CA证书 二,解决: 在res文件夹下新建目录xml,然后创建文件network_security_config.xml 内容如下: <?xml version="1.0" encoding="utf-8"?> <networ 阅读全文
posted @ 2025-04-26 08:44
刘宏缔的架构森林
阅读(164)
评论(0)
推荐(0)
摘要:
一,安装第三方库gson 地址: https://mvnrepository.com/artifact/com.google.code.gson/gson build.gradle中dependencies添加: implementation 'com.google.code.gson:gson:2 阅读全文
posted @ 2025-04-26 08:44
刘宏缔的架构森林
阅读(349)
评论(0)
推荐(0)
摘要:
一,代码: xml <Button android:id="@+id/apibutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="点击这里访问接口" tools:l 阅读全文
posted @ 2025-04-26 08:44
刘宏缔的架构森林
阅读(46)
评论(0)
推荐(0)
摘要:
一,创建项目时不选择Empty Activity 例如:选择Empty Views Activity 此处可以看到默认语言是kotlin,选择语言为java 可以看到创建后的项目使用的语言是java 阅读全文
posted @ 2025-04-26 08:42
刘宏缔的架构森林
阅读(1374)
评论(0)
推荐(0)
摘要:
一,安装第三方库: 1,库地址: https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp 2,安装 在build.gradle的dependencies中增加一行: implementation 'com.squareup.okh 阅读全文
posted @ 2025-04-26 08:41
刘宏缔的架构森林
阅读(137)
评论(0)
推荐(0)
摘要:
一,代码: 1,发送参数的fragment override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) println("fir 阅读全文
posted @ 2025-04-26 08:41
刘宏缔的架构森林
阅读(71)
评论(0)
推荐(0)
摘要:
一,定义动画 1,slide_right.xml <slide xmlns:android="http://schemas.android.com/apk/res/android" android:duration="@android:integer/config_longAnimTime" and 阅读全文
posted @ 2025-04-26 08:40
刘宏缔的架构森林
阅读(32)
评论(0)
推荐(0)
摘要:
一,创建fragment,如图 二,编辑已有fragment,使可以跳转到新添加fragment 1,在已有fragment上添加一个按钮,如下: <Button android:id="@+id/gothree" android:layout_width="wrap_content" androi 阅读全文
posted @ 2025-04-26 08:39
刘宏缔的架构森林
阅读(57)
评论(0)
推荐(0)
摘要:
一,activity和fragment的区别 特性 Activity Fragment 定义 代表应用中的一个独立屏幕 代表 Activity 中的一部分 UI 或行为 生命周期 独立生命周期 依附于宿主 Activity 的生命周期 入口点 需要在 AndroidManifest.xml 中声明 阅读全文
posted @ 2025-04-26 08:39
刘宏缔的架构森林
阅读(203)
评论(0)
推荐(0)
摘要:
一,创建项目 二,项目运行的效果: 阅读全文
posted @ 2025-04-26 08:39
刘宏缔的架构森林
阅读(29)
评论(0)
推荐(0)
浙公网安备 33010602011771号