Commit 5a49aecc authored by Mygod's avatar Mygod

Give up on broken systems

parent 373222d3
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
package com.github.shadowsocks package com.github.shadowsocks
import android.app.Activity import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent import android.content.Intent
import android.content.pm.ShortcutManager import android.content.pm.ShortcutManager
import android.hardware.camera2.CameraAccessException import android.hardware.camera2.CameraAccessException
...@@ -61,7 +62,9 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever { ...@@ -61,7 +62,9 @@ class ScannerActivity : AppCompatActivity(), BarcodeRetriever {
private lateinit var detector: BarcodeDetector private lateinit var detector: BarcodeDetector
private fun fallback() { private fun fallback() {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=tw.com.quickmark"))) try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=tw.com.quickmark")))
} catch (_: ActivityNotFoundException) { }
finish() finish()
} }
......
...@@ -60,7 +60,7 @@ class ProfilesDialogFragment : LeanbackListPreferenceDialogFragment() { ...@@ -60,7 +60,7 @@ class ProfilesDialogFragment : LeanbackListPreferenceDialogFragment() {
if (index == RecyclerView.NO_POSITION) return if (index == RecyclerView.NO_POSITION) return
Core.switchProfile(profiles[index].id) Core.switchProfile(profiles[index].id)
(targetFragment as MainPreferenceFragment).startService() (targetFragment as MainPreferenceFragment).startService()
fragmentManager.popBackStack() fragmentManager?.popBackStack()
notifyDataSetChanged() notifyDataSetChanged()
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment