pull/32/head
kunfei 5 years ago
parent 6acd9bd025
commit 77433fc65e
  1. 9
      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.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import androidx.lifecycle.AndroidViewModel
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.BaseActivity import io.legado.app.base.BaseActivity
import io.legado.app.base.VMBaseActivity
import io.legado.app.utils.getViewModel
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
class AboutActivity : BaseActivity(R.layout.activity_about) { class AboutActivity : BaseActivity(R.layout.activity_about) {
@ -31,15 +28,15 @@ class AboutActivity : BaseActivity(R.layout.activity_about) {
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.menu_scoring -> { R.id.menu_scoring -> {
openIntent(Intent.ACTION_VIEW, "market://details?id=$packageName") openIntent("market://details?id=$packageName")
} }
} }
return super.onCompatOptionsItemSelected(item) return super.onCompatOptionsItemSelected(item)
} }
private fun openIntent(intentName: String, address: String) { private fun openIntent(address: String) {
try { try {
val intent = Intent(intentName) val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(address) intent.data = Uri.parse(address)
startActivity(intent) startActivity(intent)
} catch (e: Exception) { } catch (e: Exception) {

Loading…
Cancel
Save