摘要:
布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent 阅读全文
摘要:
ifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android 阅读全文
摘要:
利用Glide实现图片的三级缓存 图片加载框架之所以高效,是因为它不但封装了访问网络的步骤,而且引入了三级缓存机制。 缓存过程说明如下:(1)先到内存(运存)中查找图片;(2)有找到就直接显示内存图片,没找到的话再去磁盘(闪存)查找图片;(3)在磁盘能找到就直接显示磁盘图片,没找到的话再去请求网络; 阅读全文
摘要:
Glide是谷歌开发的图片加载框架,也是Android官方推荐的图片加载框架。 使用Glide之前需要先导入glide库:implementation 'com.github.bumptech.glide:glide:4.13.0‘ Glide的用法很简单,只需一行代码即可将网络图片加载到图像视图界 阅读全文
摘要:
gradle添加依赖: implementation 'com.squareup.okhttp3:okhttp:4.9.3' ifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.a 阅读全文
摘要:
ifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android 阅读全文
摘要:
ifest文件,网络权限申请: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schema 阅读全文
摘要:
xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="mat 阅读全文
摘要:
一、认识Looper和Handler对象 当主线程诞生时,就会去执行一个消息循环(Message Loop),以便持续监视它的消息队列(Message Queue简称MQ)。 当UI事件发生了,通常会立即丢一个Message给MQ,此时主线程就立即从MQ里边取出该消息并处理。 比如,用户在UI界面上 阅读全文
摘要:
xml配置文件: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_par 阅读全文