I just migrated my code from sdk 22 to sdk 23, and in the test cell (moto g3) I had no problems, but it turns out that there are devices that present problems (Samsung Galaxy J2) ... Before when I used compileSdkVersion = 22, both phones worked, but now that I use 23, the samsung falls ...
At the code level I try to get a getPath from a Bitmap.
First I get the getUri of the bitmap, to then use it and get the getPath, in the following way:
Bitmap bm = ((BitmapDrawable) mImagenView.getDrawable()).getBitmap();
Uri tempUri = getImageUri(getApplicationContext(), bm); //aca se caé
...
public Uri getImageUri(Context inContext, Bitmap inImage) {
if(verificarPermisoAlmacenamiento()) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
inImage.compress(Bitmap.CompressFormat.PNG, 100, bytes);
String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null); //especificamente aqui
return Uri.parse(path);
}
}
here path is null ... on the samsung.
Is it due to some change in the C library: ..... \ Android \ sdk \ sources \ android-23 \ android \ provider?
ALL help is welcome ...