ifgarces / TomaRamosUandes_android

Simulador/planificador no oficial para la toma de ramos de la Universidad de los Andes, Chile
https://bit.ly/TomadorRamosUandes
MIT License
0 stars 0 forks source link

`ImageExportHandler`: not working on all Android versions #16

Open ifgarces opened 2 years ago

ifgarces commented 2 years ago

On the following code, for some reason, for Android 8 and 9 (or perhaps on some specific devices), the given with of the targetView is 0, instead of the expected value (parent view's width), so the canvas for the Bitmap cannot be created.

val bitmap :Bitmap = Bitmap.createBitmap(
    targetView.width, tallView.height, Bitmap.Config.ARGB_8888
)
ifgarces commented 2 years ago

Update: on Android 9.0, for some reason, this exception is thrown instead, when attempting to open the stream for storing the image as a PNG file in storage: java.io.FileNotFoundException: /storage/emulated/0/Pictures/Horario/1640037201532.png (No such file or directory)

ifgarces commented 2 years ago

Update: seems to be a permission error for some android versions... This problem ain't easy to solve, will take some time.

ifgarces commented 2 years ago

I have spend quite a lot of time checking on this, but haven't still figured how to solve it. It has to do with newer android versions (11+?). Adding the stuck tag now.