public void saveBitmap(Bitmap bitmap) throws IOException
    {
            File file = new File(Environment.getExternalStorageDirectory()+"image");
            FileOutputStream out;
            try{
                    out = new FileOutputStream(file);
                    if(bitmap.compress(Bitmap.CompressFormat.PNG, 70, out))
                    {
                            out.flush();
                            out.close();
                    }
            }
            catch (FileNotFoundException e)
            {
                    e.printStackTrace();
            }
            catch (IOException e)
            {
                    e.printStackTrace();
            }
    }

 

//File.delete();  这个是删除保存在手机的临时图片代码

更多相关文章

  1. Android PopupWindow动画效果代码
  2. 收藏代码-Android状态栏工具代码
  3. android获取手机型号和手机厂商
  4. Android 2.1 GPS定位和拍照功能代码
  5. android 震动和提示音的实现代码
  6. Android 内核源代码交叉编译纺
  7. 【开发工具】判断请求源是 手机 or PC
  8. android 获取手机的各种状态

随机推荐

  1. Android 的AT命令协议栈初始化
  2. android adb网络连接方法
  3. 刚开始安卓,记录一个刚做的图片缩放程序
  4. android 发送http请求
  5. Android Root方法原理解析及Hook(一) adb
  6. 覆盖Android开发各个领域的近百个源码项
  7. Android常用命令
  8. javaeye中的一些好的android博客
  9. 项目中listView常用属性设置
  10. 〖Android〗dropbear一些操作命令备忘