PURPLE FACE
PURPLE FACE

Reputation: 1

In B4A, external folder storage

My codes should be correct, but I could not get the correct resourse to edit my Manifest file to allow SAVE permission.

Private Sub btn_SAVE_Click      
  Dim const FILENAME As String = "MyTextFile.txt"   
  Dim const FOLDER_NAME As String = "MyFolder"      
  Dim FolderPath As String  
  FolderPath = File.Combine(File.DirRootExternal,FOLDER_NAME)       

  Dim textToSave As String  
  textToSave=txtbox_TEXT01.Text 
  If File.Exists(FolderPath, FILENAME) = False Then          
    File.MakeDir(File.DirRootExternal, FOLDER_NAME)
  End If 

  File.WriteString(FolderPath,FILENAME,textToSave)  
  'Dim Out As OutputStream  
  'Out = File.OpenOutput(FolderPath, FILENAME,False)     
  'Out.WriteBytes(textToSave.GetBytes("UTF8"),0,0)  
  'Out.Close    
   ToastMessageShow("File saved OK!", True) 
End Sub

My APP crashed and quitted, after clicking SAVE button.

Upvotes: 0

Views: 42

Answers (0)

Related Questions