- 博客(4)
- 收藏
- 关注
原创 一行代码实现沉浸式状态栏
第一步:使用systembartint compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' 第二步:一行代码实现沉浸式状态栏 SystemBarUI.initSystemBar(this,R.color.red); 第三步:在activity资源文件根目录添加 android:fitsSystem
2017-05-12 11:02:04 345
原创 BitmapFactory.Options压缩图片
BitmapFactory.Options opts = new BitmapFactory.Options(); //只请求图片宽高,不解析图片像素 opts.inJustDecodeBounds = true; //返回null,获取图片宽高,保存在opts对象中 String path = getExternalCacheDir()+"haha.jpg"; BitmapFactory.dec
2017-05-12 10:54:22 584
原创 Android7.0启用摄像头拍照
public void takePhone(){ //启动拍照的Activity Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String path = getExternalCacheDir()+"haha.jpg"; Uri uri = null; //android7.0使用
2017-05-12 10:46:04 290
原创 Android Toast
避免重复弹出toastprivate static Toast toast; public static void showToast(Context context, String content) { if (toast == null) { toast = Toast.make
2017-05-11 21:49:56 134
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人