zoukankan      html  css  js  c++  java
  • 将ImageView中的图片保存到本地相冊

    private void SaveImageToSysAlbum() {
    		if (FileUtil.isSdCardExist()) {
    			BitmapDrawable bmpDrawable = (BitmapDrawable)mFullImageView.getDrawable();
    			Bitmap bmp = bmpDrawable.getBitmap();
    			if (bmp != null) {
    				try {
    					ContentResolver cr = getContentResolver();
    					String url = MediaStore.Images.Media.insertImage(cr, bmp,
    							String.valueOf(System.currentTimeMillis()), "");
    					Toast.makeText(this, getString(R.string.save_succ), Toast.LENGTH_SHORT).show();
    
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}else {
    				Toast.makeText(this, getString(R.string.no_iamge_save_fail), Toast.LENGTH_SHORT).show();
    			}
    		}else {
    			Toast.makeText(this, getString(R.string.no_sdcard_save_fail), Toast.LENGTH_SHORT).show();
    		}
    		sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
    	}

  • 相关阅读:
    数据库函数
    数据库查询习题整理(二)
    数据库查询习题整理(一)
    1202数据库查询
    1201新课程TSQL语句
    1123项目第五天
    1121项目第四天
    1120项目第三天
    14
    にちかん
  • 原文地址:https://www.cnblogs.com/blfshiye/p/5165134.html
Copyright © 2011-2022 走看看