preheat the shell in splash screen
This commit is contained in:
parent
9a31f2b7e3
commit
7c1392de94
|
@ -4,18 +4,22 @@ import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
|
||||||
class SplashScreenActivity : AppCompatActivity() {
|
class SplashScreenActivity : AppCompatActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
if (getDefaultSharedPreferences(this).getBoolean("firstLaunch", true)) {
|
//Preheat the shell
|
||||||
startActivity(Intent(this, WelcomeActivity::class.java))
|
Shell.getShell {
|
||||||
finish()
|
if (getDefaultSharedPreferences(this).getBoolean("firstLaunch", true)) {
|
||||||
} else {
|
startActivity(Intent(this, WelcomeActivity::class.java))
|
||||||
startActivity(Intent(this, MainActivity::class.java))
|
finish()
|
||||||
finish()
|
} else {
|
||||||
|
startActivity(Intent(this, MainActivity::class.java))
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue