The user import bitmaps which have been sent to the tablet - normally by downloading from an email. The bitmaps are stored in an internal folder and the Filename stored in a database, so that the correct bitmap can be opened and displayed when required.
Since recent Android updates our Apps can no longer access the tablet's folders directly. I'm using FileHandler to use the tablet's file browser to select the file. This returns Result.Filename and Result.Realname. Most of the time Result.Realname gives me the correct filename. However, with Android 13 it depends on how the user selects the file: If they select it from a list then I get the correct filename, but if they select it from a page of icons then Result.Realname is just a random integer eg 103276337637.png. Result.Filename is the same integer, but appended to the end of the path.
The most promising work around is this one Getting file info using uri but it looks complicated.
In this post Get name of file from content chooser there is a quote from our leader saying "There is no reliable way to get the file name. Content providers are not expected to return the file name in the URI."
Before I get bogged down, is there a simple workaround? Or am I wasting my time trying?
Since recent Android updates our Apps can no longer access the tablet's folders directly. I'm using FileHandler to use the tablet's file browser to select the file. This returns Result.Filename and Result.Realname. Most of the time Result.Realname gives me the correct filename. However, with Android 13 it depends on how the user selects the file: If they select it from a list then I get the correct filename, but if they select it from a page of icons then Result.Realname is just a random integer eg 103276337637.png. Result.Filename is the same integer, but appended to the end of the path.
The most promising work around is this one Getting file info using uri but it looks complicated.
In this post Get name of file from content chooser there is a quote from our leader saying "There is no reliable way to get the file name. Content providers are not expected to return the file name in the URI."
Before I get bogged down, is there a simple workaround? Or am I wasting my time trying?