mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-27 16:10:58 +01:00
Use flag secure to hide from recents
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -136,15 +138,21 @@ public class FragmentDialogBase extends DialogFragment {
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
if (Helper.noHistory(getContext()))
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||
super.startActivity(intent);
|
||||
try {
|
||||
super.startActivity(intent);
|
||||
} catch (ActivityNotFoundException ex) {
|
||||
Log.e(ex);
|
||||
ToastEx.makeText(getContext(), getString(R.string.title_no_viewer, intent.getAction()), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
if (Helper.noHistory(getContext()))
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
try {
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
} catch (ActivityNotFoundException ex) {
|
||||
Log.e(ex);
|
||||
ToastEx.makeText(getContext(), getString(R.string.title_no_viewer, intent.getAction()), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user