mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 05:52:52 +00:00
Merge pull request #716 from DerEnderKeks/fix-recent-apps-behavior
Fixed that app vanished from recent apps list after locking
This commit is contained in:
commit
efb5b10a76
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.beemdevelopment.aegis.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
|
@ -19,6 +20,8 @@ import com.beemdevelopment.aegis.ThemeMap;
|
|||
import com.beemdevelopment.aegis.ui.dialogs.Dialogs;
|
||||
import com.beemdevelopment.aegis.vault.VaultManagerException;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -89,8 +92,15 @@ public abstract class AegisActivity extends AppCompatActivity implements AegisAp
|
|||
@Override
|
||||
public void onLocked(boolean userInitiated) {
|
||||
setResult(RESULT_CANCELED, null);
|
||||
try {
|
||||
Method method = Activity.class.getDeclaredMethod("finish", int.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(this, 2); // FINISH_TASK_WITH_ACTIVITY = 2
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
finishAndRemoveTask();
|
||||
}
|
||||
}
|
||||
|
||||
protected AegisApplication getApp() {
|
||||
return _app;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue