Merge remote-tracking branch 'origin/master' into navigation_new
This commit is contained in:
commit
a15e4d04ec
|
|
@ -3,6 +3,7 @@ package ru.touchin.extensions
|
|||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.ColorRes
|
||||
|
|
@ -28,4 +29,12 @@ fun Activity.setupTaskDescriptor(label: String, @DrawableRes iconRes: Int, @Colo
|
|||
)
|
||||
setTaskDescription(taskDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Activity.openGooglePlay(packageName: String) {
|
||||
try { //try to open play market
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName")))
|
||||
} catch (e: android.content.ActivityNotFoundException) {
|
||||
openBrowser("https://play.google.com/store/apps/details?id=$packageName")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue