This commit is contained in:
Phillip Thelen 2019-03-13 14:41:32 +01:00
parent a872f89326
commit 942a58bc23

View file

@ -94,17 +94,14 @@ class SubscriptionDetailsView : LinearLayout {
}
}
fun openSubscriptionWebsite() {
private fun openSubscriptionWebsite() {
if (plan?.paymentMethod != null) {
val intent: Intent = if (plan?.paymentMethod == "Google") {
Intent(Intent.ACTION_VIEW)
.setComponent(ComponentName("com.android.vending",
"com.google.android.finsky.activities.MainActivity"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
val url = if (plan?.paymentMethod == "Google") {
"https://play.google.com/store/account/subscriptions"
} else {
Intent(Intent.ACTION_VIEW, Uri.parse(BuildConfig.BASE_URL + "/"))
BuildConfig.BASE_URL + "/"
}
context.startActivity(intent)
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
}
}
}