![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
这条路黑到底
越努力,越幸运!
展开
-
Attempt to invoke virtual method int android.graphics.Bitmap.getWidth() on a null object
公司之前老项目升级:之前使用:BitmapFactory.decodeFile(path,myOptions);一直很好的,今天突然 ‘int android.graphics.Bitmap.getWidth()’ on a null 一直报null。奇怪的是,28一下手机正常,29不正常。马上想到是Android Q的特性。 BitmapFactory.Options myOptions = new BitmapFactory.Options(); myOptions.inJustD原创 2020-05-23 12:18:28 · 5235 阅读 · 1 评论 -
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)设置后的效果
android app开发时,查看之前的会有这样的设置。 //如果sdk版本大于4.4则设置状态栏透明化 会导致首页状态栏减少 /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window window = getWindow(); window.setFlags原创 2016-11-15 14:14:21 · 20447 阅读 · 1 评论 -
android 5.x设置actionBar色调
android 5.x提供了色调的方法,其实很简单,直接上代码。 api至少21./ 创建Palette对象 Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() { @TargetApi(Build.VERSION_CODES.LOL原创 2016-12-05 20:28:28 · 441 阅读 · 0 评论 -
android的Notification折叠
android 的Notification 看起来简单,但是api老是改。用的时候确实很麻烦。这里写一个折叠的Demo。 布局文件:activity_main<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xml原创 2016-12-06 14:54:50 · 3328 阅读 · 0 评论 -
android studio谁用butterknife(正确地打开方式)
最近在用butterknife。网上有很多引用的方法。好多不太准确。这里就说一哈。 1、在android studio中添加插件:butterknife 2.在项目的build.gradle中添加: classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ // 添加这行 3.添加依赖: compile ‘com.jakewha原创 2016-11-15 16:36:34 · 572 阅读 · 0 评论 -
android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/Camera/2018012Android 7.0相继崩溃的问题
今天项目的bug:android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/Camera/20180121181328.jpg exposed beyond app through ClipData.Item.getUri()build.gradle中加入:原创 2018-01-21 18:24:53 · 12092 阅读 · 8 评论