mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-06-05 21:59:15 +02:00
add Simple Launchers settings as an icon
This commit is contained in:
@ -5,9 +5,16 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.provider.Settings
|
||||
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||
import com.simplemobiletools.launcher.activities.SettingsActivity
|
||||
import com.simplemobiletools.launcher.helpers.UNINSTALL_APP_REQUEST_CODE
|
||||
|
||||
fun Activity.launchApp(packageName: String) {
|
||||
// if this is true, launch the app settings
|
||||
if (packageName == this.packageName) {
|
||||
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||
return
|
||||
}
|
||||
|
||||
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
|
||||
try {
|
||||
startActivity(launchIntent)
|
||||
|
Reference in New Issue
Block a user