I could do it this way
Listview and Label Components
Uses System.IOUtils
At the Form Show event
carregadiretorio(GetSharedDownloadsDir);
At Listview’s Itemclickex event
if ListView1.Items[ListView1.ItemIndex].Detail='folder' then
carregadiretorio(LbFolder.Text+PathDelim+ListView1.Items[ListView1.ItemIndex].Text)
else if ListView1.Items[ListView1.ItemIndex].Detail='voltar' then
carregadiretorio(copy(ExtractFilePath(LbFolder.text), 0,Length(ExtractFilePath(LbFolder.text))-1));
and the database that loads the directory
procedure carregadiretorio(diretorio: string);
var
listapastas, listaarquivos: TStringDynArray;
pasta, arquivo: string;
LItem: TListViewItem;
begin
ListView1.Items.Clear;
LbFolder.Text := diretorio;
listapastas := TDirectory.GetDirectories(diretorio);
listaarquivos := TDirectory.GetFiles(diretorio);
ListView1.BeginUpdate;
LItem := ListView1.Items.Add;
LItem.Detail := 'voltar';
LItem.Text := '..<<';
for pasta in listapastas do
begin
//Carrega as Pastas
LItem := ListView1.Items.Add;
LItem.Detail := 'folder';
LItem.Text := Copy(pasta, Length(ExtractFilePath(pasta))+1, Length(pasta));
end;
for arquivo in listaarquivos do
begin
//Carrega os Arquivos
LItem := ListView1.Items.Add;
LItem.Detail := 'file';
LItem.Text := ExtractFileName(arquivo);
end;
ListView1.EndUpdate;
end;
Another solution follows the link
http://bluexmas.tistory.com/427
Out of curiosity, but why would the user need this backup?.. at what point.
– Jefferson Rudolf
if user changes device, it can recover all data
– Maurício