In a larger B4J project I have integrated the display of a programme description in an extra panel. This works very well so far.
Originally I had planned to display this PDF-file directly from the assets. ReadOnly access is supposedly possible. But it doesn't really work, because the file is apparently opened for display with read/write access, although nothing is written to the file. Ok, so I copy the file from the assets before displaying it and then that works too. But now I would like to delete this temporary file again when the programme ends. This can be done with the routine MainForm_Closed. However, this only works when the programme is closed regularly. If the user closes the programme while the file is open in the Reader by closing the window, the file is still in access and cannot be deleted. Is there a workaround for this case? I imagine that with ANDROID this was possible by pressing the BACK key or the MAIN key. Is there a similar function under B4J? Is it possible to intercept the closing of the window programmatically and still carry out a few actions?
Originally I had planned to display this PDF-file directly from the assets. ReadOnly access is supposedly possible. But it doesn't really work, because the file is apparently opened for display with read/write access, although nothing is written to the file. Ok, so I copy the file from the assets before displaying it and then that works too. But now I would like to delete this temporary file again when the programme ends. This can be done with the routine MainForm_Closed. However, this only works when the programme is closed regularly. If the user closes the programme while the file is open in the Reader by closing the window, the file is still in access and cannot be deleted. Is there a workaround for this case? I imagine that with ANDROID this was possible by pressing the BACK key or the MAIN key. Is there a similar function under B4J? Is it possible to intercept the closing of the window programmatically and still carry out a few actions?