I want to make a loop so selected items in my listview delete from the directory.
procedure TFContact.BtnDeleteClick(Sender: TObject);
var
SecItem, BUFPath : string;
i : Integer;
begin
if ListViewTab5.Selected <> nil then
for i := 0 to ListViewTab5.Items.Count - 1 do
begin
SecItem:= TListViewItem(ListViewTab5.Selected).Text;
BUFPath:= '/storage/emulated/0/Backup/'+SecItem;
TFile.Delete(BUFPath);
end
else
ShowMessage('File Deleted Succesfully');
end;
Try this: