
android 开发常见问题处理
李二二
一个靓仔的梦想航线
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于读取本地Json文件的坑
读取本地Json文件必须要一次性全部读取,不能一行一行读取否则会出现各种你不理解的坑且读取的数据并不是你想要的数据,方法如下 InputStream is = null; ByteArrayOutputStream bos = null; try { is = context.getAssets().open("homepage.json"); bos = new ByteArrayOutputStream(); byte[] bytes = new byte[is.availa原创 2022-02-11 00:25:48 · 334 阅读 · 0 评论 -
Intent 与 PendingIntent 页面跳转
Intent 使用 Intent intent = new Intent(context,class.java); startActivity(intent); PendingIntent 使用 try { PendingIntent pi = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); pi.send(); } catch (PendingIntent....原创 2022-01-24 22:44:06 · 2891 阅读 · 0 评论 -
常规解决问题网站整理
属性动画地址 https://blog.youkuaiyun.com/weixin_37160260/article/details/79916058 音频管理切换 https://blog.ccsdn 轮子整理 https://blog.youkuaiyun.com/shenggaofei/article/details/106983364 android 自带速度插值器 https://www.jianshu.com/p/6ac62884621c ...原创 2020-10-15 11:04:11 · 223 阅读 · 0 评论 -
AndroidStudio 自带UI检测工具Monitor
Monitor 位置 Tools-->Android-->Android device Monitor Monitor 开启时 Window ---> Open perspec... 即可开启Hierarchy Viewer 关于商业手机无法显示Hierarchy Viewer 检测是否可开启Hierarchy Viewer ...原创 2020-06-15 16:54:55 · 25089 阅读 · 0 评论 -
android 4.4 内存挂载读取路径方法
通过广播intent 获取对应的路径...... 每当有usb /tf /sd 挂载都会回调该广播并从以下API可读取路径 if (Intent.ACTION_MEDIA_MOUNTED.equals(intent.getAction())) { Log.w("TAG","path = "+intent.getData().getPath()) } 需要注册 Intent.ACTION_MEDIA_MOUNTED ...原创 2020-05-30 10:55:56 · 349 阅读 · 0 评论 -
byte[] 相关的一些处理方法
原始下位机回传的原始数据 byte最后转一下 或者直接参照twoCharCompareZero 进行判断 byte 转 8位 byte[] public static byte[] getBooleanArray(byte b) { byte[] array = new byte[8]; for (int i = 7; i >= 0; i--) { array[i] = (byte)(b & 1); b = (byte) (b >...原创 2020-05-22 16:13:38 · 475 阅读 · 0 评论 -
关于Luancher 开发 ------ 关机功能
try { val intent = Intent( "android.intent.action.ACTION_REQUEST_SHUTDOWN") intent.putExtra("android.intent.extra.KEY_CONFIRM", true) // 其中false换成true,会弹出是否关机的确认窗口 intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK context!!.star.原创 2020-05-20 16:26:52 · 281 阅读 · 0 评论 -
关于android文件路径 转 Bitmap
String filePath = "你的文件路径" Bitmap bitmap = BitmapFactory.decodeFile(filePath); 系统 SystemTimeMills 转指定格式 public static String format(Date d, String s){ SimpleDateFormat sdf=new SimpleDate...原创 2020-04-26 15:42:11 · 3969 阅读 · 0 评论