Lazarus

Programming => Operating Systems => Android => Topic started by: rsu333 on February 24, 2021, 03:59:45 pm

Title: How to load list of internal app file in jlistview ?
Post by: rsu333 on February 24, 2021, 03:59:45 pm
Is it possible to load list of files present in internal app to jlistview ?
When using command
    self.getListoffiles
then how to display it in jlistview ?
.
Thank you.
Title: Re: How to load list of internal app file in jlistview ?
Post by: jmpessoa on February 27, 2021, 03:55:47 am
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jButton1Click(Sender: TObject);
  2. var
  3.   list: TDynArrayOfString;
  4.   count, i: integer;
  5. begin
  6.     list:= Self.GetFileList(Self.GetEnvironmentDirectoryPath(dirDownloads)); //or another dir
  7.     count:= Length(list);
  8.     for i:= 0 to count-1 do
  9.     begin
  10.        jListView1.Add(list[i]);
  11.     end;
  12.     SetLength(list, 0);  //free array
  13. end;
  14.  
Title: Re: How to load list of internal app file in jlistview ?
Post by: rsu333 on February 27, 2021, 07:53:12 am
Thanks a lot. I will try it soon.
Title: Re: How to load list of internal app file in jlistview ?
Post by: jmpessoa on February 27, 2021, 06:44:11 pm

And don't forget:  you need request  "user permission" to read and write files informations ...
TinyPortal © 2005-2018