- 博客(6)
- 收藏
- 关注
转载 androidQ(兼容) uri获取绝对路径和uri获取获取文件
首先权限必须添加获取public static String getFilePathFromURI(Context context, Uri contentUri) { File rootDataDir = context.getExternalFilesDir(null);// MyApplication.getMyContext().getExternalFi...
2020-03-15 01:31:07
1658
原创 通知栏权限工具类NotificationsUtils
public class NotificationsUtils { private static final String CHECK_OP_NO_THROW = "checkOpNoThrow"; private static final String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION"; /** * ...
2019-12-16 10:37:01
156
原创 Home 按键监听
可以通过广播来监听Home按键,对应的Action是Intent.ACTION_CLOSE_SYSTEM_DIALOGS。(代码使用的kotlin)#创建HomeReceiverclass HomeReceiver : BroadcastReceiver(){ private val SYSTEM_DIALOG_REASON_KEY = "reason" private v...
2019-12-16 10:35:40
313
原创 关于设置EditText字数限制 并在输入超过最大值时给出提示
## 标题关于设置EditText字数限制 并在输入超过最大值时给出提示**//设置监听 etPictureSelectContent.addTextChangedListener(this);//在监听状态中写入逻辑代码 @Override public void beforeTextChanged(CharSequence s, int start, int count, i...
2019-08-12 11:19:23
309
原创 解决Androdi 8.0 Notification 无效
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);Notification notification = null;String notId = “123”;String notName = “渠道Name”;String notTitle = “测试”;S...
2019-08-12 11:18:01
166
原创 ViewPager禁止滑动
不能左右滑动ViewPagerpublic class NoScrollViewPager extends ViewPager { //是否可以左右滑动?true 可以,像Android原生ViewPager一样。 // false 禁止ViewPager左右滑动。 private boolean scrollable = false; public Cust...
2019-01-25 09:28:08
135
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人