/** * 更新相册某个文件 */

public static void photoUpdates(Context context, File file) { if (!file.exists()) { return; } try {

MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), file.getName(), null); } catch (FileNotFoundException e) {

e.printStackTrace(); }

Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); intent.setData(Uri.fromFile(file)); context.sendBroadcast(intent); }

/**获取view 缓存(例如屏幕截屏,root layout )*/

public static Bitmap getViewCacheBitMap(View view) {

view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bitmap = view.getDrawingCache(); return bitmap; }

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com

特别注意:本站所有转载文章言论不代表本站观点!

本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐