Android Question TargetSdkVersion from 19 to 26 some commands don't work

Urishev

Member
Licensed User
Longtime User
When moving targetSdkVersion from 19 to 26, the following code stopped working:
Sub ListFiles
Dim list_files As List
list_files.Initialize
File.MakeDir(File.DirRootExternal, "Text/")
dir=File.Combine(File.DirRootExternal,"Text/")
list_files=File.ListFiles(dir)
For i= list_files.Size -1 To 0 Step -1 ' error "(List) Not initialized"
If i = list_files.Size-Selected-1 Then
Filename = "ECG_Reader/" & list_files.Get(list_files.Size-Selected-1)
ListView1.AddTwoLines(list_files.Get(list_files.Size-Selected-1),"")
End if
End Sub

How to fix?
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Urishev

Member
Licensed User
Longtime User
In targetSdkVersion 26, this code does not work. What need to do?
B4X:
Sub ListFiles
  Dim list_files As List
    list_files.Initialize   
    File.MakeDir(File.DirRootExternal, "ECG_Reader/")
    dir=File.Combine(File.DirRootExternal,"ECG_Reader/")
    list_files=File.ListFiles(dir)
    For i= list_files.Size -1 To 0 Step -1 ' error "(List) Not initialized"
       If i = list_files.Size-Selected-1 Then       
         Filename = "ECG_Reader/" & list_files.Get(list_files.Size-Selected-1)
         ListView1.AddTwoLines(list_files.Get(list_files.Size-Selected-1),"")
      End if
End Sub
 
Upvote 0

Urishev

Member
Licensed User
Longtime User
How to use (Runtime) permission? Put on the manifest?
Something hard. It used to be all easy.
 
Upvote 0
Top