|
|
@ -28,6 +28,7 @@ import android.content.res.Configuration;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.PowerManager;
|
|
|
|
import android.os.PowerManager;
|
|
|
|
import android.view.MenuItem;
|
|
|
|
import android.view.MenuItem;
|
|
|
|
|
|
|
|
import android.view.WindowManager;
|
|
|
|
import android.widget.Toast;
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
@ -72,6 +73,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
this.contacts = hasPermission(Manifest.permission.READ_CONTACTS);
|
|
|
|
this.contacts = hasPermission(Manifest.permission.READ_CONTACTS);
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
|
|
|
|
|
|
boolean no_history = prefs.getBoolean("no_history", false);
|
|
|
|
|
|
|
|
if (no_history)
|
|
|
|
|
|
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.getClass().equals(ActivityMain.class)) {
|
|
|
|
if (!this.getClass().equals(ActivityMain.class)) {
|
|
|
|
String theme = prefs.getString("theme", "light");
|
|
|
|
String theme = prefs.getString("theme", "light");
|
|
|
@ -205,8 +209,6 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void startActivity(Intent intent) {
|
|
|
|
public void startActivity(Intent intent) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (Helper.noHistory(this))
|
|
|
|
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
|
|
|
|
|
|
|
super.startActivity(intent);
|
|
|
|
super.startActivity(intent);
|
|
|
|
} catch (ActivityNotFoundException ex) {
|
|
|
|
} catch (ActivityNotFoundException ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
@ -217,8 +219,6 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void startActivityForResult(Intent intent, int requestCode) {
|
|
|
|
public void startActivityForResult(Intent intent, int requestCode) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (Helper.noHistory(this))
|
|
|
|
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
|
|
|
|
|
|
|
super.startActivityForResult(intent, requestCode);
|
|
|
|
super.startActivityForResult(intent, requestCode);
|
|
|
|
} catch (ActivityNotFoundException ex) {
|
|
|
|
} catch (ActivityNotFoundException ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
|