From 54a5410af3d6af76c4baff45933621a19d2af58e Mon Sep 17 00:00:00 2001 From: GKF Date: Thu, 13 Jun 2019 14:29:59 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/about/AboutActivity.kt | 3 +-- .../java/io/legado/app/ui/about/AboutFragment.kt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 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 9afc8ac78..c50e14a46 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 @@ -40,7 +40,7 @@ class AboutActivity : BaseActivity() { return super.onCompatOptionsItemSelected(item) } - internal fun openIntent(intentName: String, address: String) { + private fun openIntent(intentName: String, address: String) { try { val intent = Intent(intentName) intent.data = Uri.parse(address) @@ -48,6 +48,5 @@ class AboutActivity : BaseActivity() { } catch (e: Exception) { toast(R.string.can_not_open) } - } } diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index 71ac65754..db9285137 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -1,10 +1,13 @@ package io.legado.app.ui.about +import android.content.Intent +import android.net.Uri import android.os.Bundle import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import io.legado.app.App import io.legado.app.R +import io.legado.app.utils.toast class AboutFragment : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { @@ -18,4 +21,15 @@ class AboutFragment : PreferenceFragmentCompat() { } return super.onPreferenceTreeClick(preference) } + + private fun openIntent(intentName: String, address: String) { + try { + val intent = Intent(intentName) + intent.data = Uri.parse(address) + startActivity(intent) + } catch (e: Exception) { + toast(R.string.can_not_open) + } + + } } \ No newline at end of file