Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android e中保存获取图像并查找路径_Android - Fatal编程技术网

在android e中保存获取图像并查找路径

在android e中保存获取图像并查找路径,android,Android,我使用这些方法来保存和获取图像 public void saveImage(Context context, Bitmap b, String name) { FileOutputStream out; try { out = context.openFileOutput(name, Context.MODE_PRIVATE); b.compress(Bitmap.CompressFormat.JPEG, 90, out);

我使用这些方法来保存和获取图像

public void saveImage(Context context, Bitmap b, String name) {   
   FileOutputStream out;
     try {
         out = context.openFileOutput(name, Context.MODE_PRIVATE);
         b.compress(Bitmap.CompressFormat.JPEG, 90, out);
         out.close();

     } catch (Exception e) {
         e.printStackTrace();
     }
 }
这是getImage

public Bitmap getImageBitmap(Context context, String name) {
    try {
        FileInputStream fis = context.openFileInput(name);
        Bitmap b = BitmapFactory.decodeStream(fis);
        fis.close();

        return b;
    } catch (Exception e) {
    }
    return null;
}
这种方式对我来说很好,但现在我需要将图像上传到服务器上,为此我需要图像的路径。 你知道我如何在不创建新图像的情况下找到它吗?

使用与openFileInput和openFileOutput一起使用的文件名