Calling apk via intent for installation, right after crashes and aborts the app

I created a way to update my application via programming, until everything is fine, the code mentioned below works, when it opens the screen asking if it will install or cancel the installation, after the call of the apk by SharedActivityContext my application freezes, if I click Cancel my application does not continue remaining process, hangs and after a while appears to close or wait. I am using Delphi 10.1 Berlin.

     MyFile := TFileStream.Create(GetSharedDownloadsDir + '/MeuApp.apk', fmCreate);

     IdHTTP1.Get(Caminho_D, MyFile);

     aFile  := TJfile.JavaClass.Init(stringtojstring(GetSharedDownloadsDir), StringToJString('MeuApp.apk'));
     Intent := TJIntent.Create;
     Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
     Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
     Intent.setDataAndType(TJnet_Uri.JavaClass.fromFile(aFile),StringToJString('application/vnd.android.package-archive'));

     SharedActivityContext.startActivity(Intent);

     MyFile.Free;

     Close; //Fecha o formulário de atualização (executa mas não funciona)
Author: MatheusP, 2020-06-08