![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
n920396119
这个作者很懒,什么都没留下…
展开
-
Android通知栏监听
通过继承 NotificationListenerService实现,它允许应用程序在创建或删除时接收有关通知的信息。class MyNotificationListenerService : NotificationListenerService() { private val pkgName = this.javaClass.name /** * 接收任何到通知 * @param sbn StatusBarNotification */ o.原创 2022-01-09 23:37:44 · 2525 阅读 · 0 评论 -
Android监控电池电量和充电状态
确定当前充电状态首先,确定当前充电状态。BatteryManagerBatteryManagerBatteryManager会在一个包含充电状态的粘性Intent中广播所有电池和充电详情。由于它是一个粘性 Intent,因此您并不需要如下一代码段中所示的那样通过简单地调用registerReceiver传入null作为接收器来注册BroadcastReceiverBroadcastReceiverBroadcastReceiver,便可返回当前电池状态 Intent。您可以在此处传入...原创 2022-01-09 23:19:50 · 3411 阅读 · 0 评论 -
AgentWeb使用CoolIndicator进度条
引入依赖implementation 'com.github.Justson:CoolIndicator:v1.0.0' CoolIndicatorLayout布局 public class CoolIndicatorLayout extends BaseIndicatorView { CoolIndicator mCoolIndicator = null; public CoolIndicatorLayout(Context context) { th原创 2022-01-03 20:47:05 · 992 阅读 · 0 评论 -
AgentWeb简易使用
简介AgentWeb 是一个基于的 Android WebView ,极度容易使用以及功能强大的库,提供了 Android WebView 一系列的问题解决方案 ,并且轻量和极度灵活。使用引用依赖 implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.0-alpha.1-androidx' // (必选) implementation 'com.github.Justson.AgentWeb:agentweb-file原创 2022-01-03 20:37:42 · 3121 阅读 · 0 评论 -
Android简单二维码库使用
本文篇文章使用的是Github:GitHub - yipianfengye/android-zxingLibrary: 几行代码快速集成二维码扫描功能原创 2021-12-25 16:33:20 · 4500 阅读 · 0 评论 -
Android自定义Dialog设置宽占满屏幕,高自适应
写一个自定义Dialog继承自Dialog,需要重写里面的构造方法和onCreate方法。public class MyDialog extends Dialog { public MyDialog(@NonNull Context context) { super(context); } @Override protected void onCreate(Bundle savedInstanceState) { super.onC.原创 2021-10-31 19:57:35 · 3164 阅读 · 0 评论 -
Retrofit2的简单使用
Retrofit是网络请求库,适用于Android和Java的类型安全HTTP客户端。本文以淘宝IP地址库为测试地址网络权限<uses-permission android:name="android.permission.INTERNET"/>依赖implementation 'com.squareup.retrofit2:retrofit:2.9.0'1、创建Retrofit实例Retrofit retrofit = new Retrofit.Builder原创 2021-10-24 16:56:21 · 173 阅读 · 0 评论 -
Android Glide基本使用总结
依赖dependencies { implementation 'com.github.bumptech.glide:glide:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'}原创 2021-10-16 11:03:32 · 769 阅读 · 0 评论