mirror of
https://github.com/MaintainTeam/LastPipeBender.git
synced 2025-03-04 15:28:21 +03:00
33 lines
1,010 B
Java
33 lines
1,010 B
Java
|
|
||
|
package org.schabi.newpipe;
|
||
|
|
||
|
import android.annotation.SuppressLint;
|
||
|
import android.app.Activity;
|
||
|
import android.content.Intent;
|
||
|
import android.os.Build;
|
||
|
import android.os.Bundle;
|
||
|
|
||
|
public class PanicResponderActivity extends Activity {
|
||
|
|
||
|
public static final String PANIC_TRIGGER_ACTION = "info.guardianproject.panic.action.TRIGGER";
|
||
|
|
||
|
@SuppressLint("NewApi")
|
||
|
@Override
|
||
|
protected void onCreate(Bundle savedInstanceState) {
|
||
|
super.onCreate(savedInstanceState);
|
||
|
|
||
|
Intent intent = getIntent();
|
||
|
if (intent != null && PANIC_TRIGGER_ACTION.equals(intent.getAction())) {
|
||
|
// TODO explicitly clear the search results once they are restored when the app restarts
|
||
|
// or if the app reloads the current video after being killed, that should be cleared also
|
||
|
ExitActivity.exitAndRemoveFromRecentApps(this);
|
||
|
}
|
||
|
|
||
|
if (Build.VERSION.SDK_INT >= 21) {
|
||
|
finishAndRemoveTask();
|
||
|
} else {
|
||
|
finish();
|
||
|
}
|
||
|
}
|
||
|
}
|