安卓开发
倚肆
请大家多多点赞关注收藏,若有问题可私信。
ε=ε=ε=(#>д<)ノ
展开
-
安卓开发:2、设置前台服务 (将后台服务Service设置为前台服务 Service)
第一步:在Service中编写通知方法(函数),并调用,下面实例中是在onCreate()中调用的private void startNotificationForeground() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { String CHANNEL_ID = "NFCService"; notificationChannel = new Notificatio原创 2022-03-23 21:25:04 · 3321 阅读 · 0 评论 -
安卓开发:1、自定义控件(自定义View)(自定义圆形图片控件ImageView)
在写android的时候使用到了自定控件,下面借着自定义圆形图片控件来记录一下控件的自定义方法。自定义控件第1步:创建java文件CircleImageView.javapublic class CircleImageView extends AppCompatImageView { private Paint paint = null;//画笔 private int radius;//圆形半径 private float scale;//图片缩放比例 private原创 2022-03-20 01:33:27 · 3101 阅读 · 1 评论