Android Question Toastmessage followed by long do while loop

joop

Active Member
Licensed User
Longtime User
This is the code :

B4X:
Sub Load_wordsarray_with_wordsfile

Dim TextReader1 As TextReader
Dim line As String
Dim i As Int
Dim words_array (300000)

ToastMessageShow("Loading file ", True)
TextReader1.Initialize(File.OpenInput(File.DirAssets, "file.txt"))

line = TextReader1.ReadLine
        Do While line <> Null
          words_array(i)= line
          line = TextReader1.ReadLine
          i=i+1
        Loop

TextReader1.Close

End Sub

It takes about 4 seconds to load the file ,and what happens is that
the message "Loading file" is displayed after the array is loaded.

Is it possible to display the "Loading file" before the array is loaded.
 

joop

Active Member
Licensed User
Longtime User
Jake, I didnt know about ProgressDialog Thanks. !
Erel The file is about 3 Meg .
 
Upvote 0
Top