代码如下:
private void saveMyBitmap(Bitmap bitmap,String photoName){
String path = Environment.getExternalStorageDirectory()+"\\";
File file = new File(path+photoName+".jpg");
try {
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG,75,fos);
System.out.println(path);
fos.flush();
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
e.printStackTrace();
}
}
private void saveMyBitmap(Bitmap bitmap,String photoName){
String path = Environment.getExternalStorageDirectory()+"\\";
File file = new File(path+photoName+".jpg");
try {
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG,75,fos);
System.out.println(path);
fos.flush();
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
e.printStackTrace();
}
}
解决方案 »
- android 源码下载问题
- android邮件客户端一般用什么保存已经下载的数据
- android使用rsa加密 在本地C代码中使用openssl签名结果和java中不同
- 按Home键后当前Activity执行的动作,保存的数据
- fb接口pan_display使用的一点问题
- Camera.open()返回一直为null是为什么
- android studio下提示gradle project sync failed.Basic functionality will not work
- android调用IKAnalyzer分词器出现内存溢出情况,求大神解决
- Android studio新人求助
- 有安卓大神嘛。请教仿微信聊天界面 我才大一我好累。救救孩子吧
- android系统升级包的一个问题
- Android解析gb2312编码的xml文件并显示
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>