hi,
I try to create a new file in the dowload folder. The file is created but does not seem to be initialized (IsInitialized returns false).
is it normal?
here is an example :
Running on Android 10 :
log extract :
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
content://com.android.providers.downloads.documents/tree/downloads
** Activity (main) Resume **
false
Here's a solution that works but it's a bad solution :
log extract :
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
content://com.android.providers.downloads.documents/tree/downloads
** Activity (main) Resume **
true
Have you another solution ?
I try to create a new file in the dowload folder. The file is created but does not seem to be initialized (IsInitialized returns false).
is it normal?
here is an example :
B4X:
dim Storage As ExternalStorage
Dim ef As ExternalFile
Storage.Initialize (Me, "Storage")
Storage.SelectDir(false)
Wait For Storage_ExternalFolderAvailable
ef = Storage.CreateNewFile(Storage.Root,"test.txt")
log (ef.IsInitialized) 'always returns false
Running on Android 10 :
log extract :
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
content://com.android.providers.downloads.documents/tree/downloads
** Activity (main) Resume **
false
Here's a solution that works but it's a bad solution :
B4X:
Do While Not(ef.IsInitialized)
ef = Storage.FindFileOrCreate(Storage.Root,"test.txt")
Loop
log (ef.IsInitialized) 'ok
log extract :
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
content://com.android.providers.downloads.documents/tree/downloads
** Activity (main) Resume **
true
Have you another solution ?
Last edited: