From 77433fc65e24743f95774b94ab156693761cbcde Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 24 Aug 2019 09:42:35 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/about/AboutActivity.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt b/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt index 303e9de4b..4648bb02d 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt @@ -5,11 +5,8 @@ import android.net.Uri import android.os.Bundle import android.view.Menu import android.view.MenuItem -import androidx.lifecycle.AndroidViewModel import io.legado.app.R import io.legado.app.base.BaseActivity -import io.legado.app.base.VMBaseActivity -import io.legado.app.utils.getViewModel import org.jetbrains.anko.toast class AboutActivity : BaseActivity(R.layout.activity_about) { @@ -31,15 +28,15 @@ class AboutActivity : BaseActivity(R.layout.activity_about) { override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.menu_scoring -> { - openIntent(Intent.ACTION_VIEW, "market://details?id=$packageName") + openIntent("market://details?id=$packageName") } } return super.onCompatOptionsItemSelected(item) } - private fun openIntent(intentName: String, address: String) { + private fun openIntent(address: String) { try { - val intent = Intent(intentName) + val intent = Intent(Intent.ACTION_VIEW) intent.data = Uri.parse(address) startActivity(intent) } catch (e: Exception) {