I don't think anything special need to do.
Maybe change the MIME type to allow loading the backed up db.
[CODE lang="b4x" title="FileHandler" highlight="4"]Public Sub Load As ResumableSub
Dim cc As ContentChooser
cc.Initialize("cc")
cc.Show("application/*", "Choose sqlite file")
Wait For CC_Result (Success As Boolean, Dir As String, FileName As String)
Dim res As LoadResult = CreateLoadResult(Success, Dir, FileName)
If res.Success Then ExtractInformationFromURI(res.FileName, res)
Return res
End Sub[/CODE]
B4X:
Private Sub BtnRestore_Click
Wait For (FileHandler1.Load) Complete (Result As LoadResult)
HandleLoadResult(Result)
End Sub
B4X:
Private Sub HandleLoadResult (Result As LoadResult)
If Result.Success Then
Try
SQL1.Close
If File.Exists(File.DirInternal, "data.db") Then
File.Delete(File.DirInternal, "data.db")
End If
File.Copy(Result.Dir, Result.FileName, File.DirInternal, "data.db")
LblMessage.Text = "File restored successfully"
SQL1.Initialize(File.DirInternal, "data.db", False)
ReadTextFromDB
Catch
LblMessage.Text = "File failed to restore"
Log(LastException)
End Try
End If
End Sub
View attachment 168000