Browse Source

minor clean up

pull/28/head
Jannik 1 year ago
parent
commit
67c1e2bfdc
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 9
      app/src/main/java/org/mosad/teapod/activity/main/MainActivity.kt
  2. 10
      app/src/main/java/org/mosad/teapod/util/ActivityUtils.kt

9
app/src/main/java/org/mosad/teapod/activity/main/MainActivity.kt

@ -48,6 +48,7 @@ import org.mosad.teapod.activity.main.fragments.SearchFragment
import org.mosad.teapod.activity.onboarding.OnboardingActivity
import org.mosad.teapod.util.DataTypes
import org.mosad.teapod.util.StorageController
import org.mosad.teapod.util.exitAndRemoveTask
import java.net.SocketTimeoutException
import kotlin.system.exitProcess
import kotlin.system.measureTimeMillis
@ -210,12 +211,4 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
startActivity(restartIntent)
}
/**
* exit and remove the app from tasks
*/
fun exitAndRemoveTask() {
this.finishAndRemoveTask()
exitProcess(0)
}
}

10
app/src/main/java/org/mosad/teapod/util/ActivityUtils.kt

@ -8,12 +8,11 @@ import android.os.Build
import android.view.View
import android.view.WindowInsets
import android.view.WindowInsetsController
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.commit
import org.mosad.teapod.R
import kotlin.system.exitProcess
/**
* Show a fragment on top of the current fragment.
@ -74,3 +73,10 @@ fun Activity.navToLauncherTask() {
}
}
/**
* exit and remove the app from tasks
*/
fun Activity.exitAndRemoveTask() {
finishAndRemoveTask()
exitProcess(0)
}

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close