Sub chooser_Result (Success As Boolean, Dir As String, FileName As String)
if Success then
Dim Dir1 As String = rp.GetSafeDirDefaultExternal("")
Dim bg As Bitmap = LoadBitmapResize(Dir, FileName, Activity.Width, Activity.Height ,True)
File.Copy(Dir,FileName,Dir1, FileName) ------ this line is throwing the error
i get following error
java.io.FileNotFoundException: /storage/emulated/0/Android/data/newkot.com/files/content:/media/external/images/media/34540 (No such file or directory)
Android version 7 samsung j7 max
b4a 7.3 sdk 23
i have included following in mainfest
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
dir ContentDir
dir1 /storage/emulated/0/Android/data/newkot.com/files
filename content://media/external/images/media/34873
filename content://media/external/images/media/34873
B4X:
Sub chooser_Result (Success As Boolean, Dir AsString, FileName AsString)if Success then
Dim Dir1 AsString = rp.GetSafeDirDefaultExternal("")
Dim bg AsBitmap = LoadBitmapResize(Dir, FileName, Activity.Width, Activity.Height ,True)
File.Copy(Dir,FileName,Dir1, FileName) ------ this line is throwing the error
changed the above as File.Copy(Dir,FileName,Dir1, "123") works well.
now the problem is to find out the selected file extension and concotinate to "123" file as extn. Exploring...
of course it will throw error. we can use the dir1 path and should give a new file name as target. ( i gave "123"). I further found that the new file can be without extension and the code
B4X:
Dim Dir1 As String = rp.GetSafeDirDefaultExternal("")
Dim bg As Bitmap = LoadBitmapResize(Dir1, "123", Activity.Width, Activity.Height ,True)