File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2016-2026 NewPipe contributors <https://newpipe.net>
3+ * SPDX-License-Identifier: GPL-3.0-or-later
4+ */
5+
6+ package org.schabi.newpipe
7+
8+ import android.annotation.SuppressLint
9+ import android.app.Activity
10+ import android.content.Intent
11+ import android.os.Bundle
12+ import org.schabi.newpipe.util.NavigationHelper
13+ class ExitActivity : Activity () {
14+ @SuppressLint(" NewApi" )
15+ override fun onCreate (savedInstanceState : Bundle ? ) {
16+ super .onCreate(savedInstanceState)
17+
18+ finishAndRemoveTask()
19+
20+ NavigationHelper .restartApp(this )
21+ }
22+
23+ companion object {
24+ @JvmStatic
25+ fun exitAndRemoveFromRecentApps (activity : Activity ) {
26+ val intent = Intent (activity, ExitActivity ::class .java)
27+
28+ intent.addFlags(
29+ Intent .FLAG_ACTIVITY_NEW_TASK
30+ or Intent .FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
31+ or Intent .FLAG_ACTIVITY_CLEAR_TASK
32+ or Intent .FLAG_ACTIVITY_NO_ANIMATION
33+ )
34+
35+ activity.startActivity(intent)
36+ }
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments