Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.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 低于安卓M(6.0)但高于棉花糖n的图像路径返回null_Android_Android 5.0 Lollipop - Fatal编程技术网

Android 低于安卓M(6.0)但高于棉花糖n的图像路径返回null

Android 低于安卓M(6.0)但高于棉花糖n的图像路径返回null,android,android-5.0-lollipop,Android,Android 5.0 Lollipop,我有一个图像的位图,想把它保存在内存中,以便获取图像的URI getImageUri(Bitmap inImage){ String path = MediaStore.Images.Media.insertImage(getApplicationContext.getContentResolver(), inImage, "Title", ""); return path; } 对于M(6.0+)版本,其工作正常,但对于棒棒糖或更低版本,其返回null。代码有什么问题?请帮我解

我有一个图像的位图,想把它保存在内存中,以便获取图像的URI

getImageUri(Bitmap inImage){
  String path =  MediaStore.Images.Media.insertImage(getApplicationContext.getContentResolver(), inImage, "Title", ""); 

  return path;
}
对于M(6.0+)版本,其工作正常,但对于棒棒糖或更低版本,其返回null。代码有什么问题?请帮我解决这个问题