Skip to content

Commit

Permalink
fix: settings crash if module updated
Browse files Browse the repository at this point in the history
  • Loading branch information
duzhaokun123 committed Dec 27, 2023
1 parent 81827e2 commit f9976aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/src/main/java/me/iacn/biliroaming/SettingDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.Typeface
Expand Down Expand Up @@ -1060,7 +1061,16 @@ class SettingDialog(context: Context) : AlertDialog.Builder(context) {
}

fun show(context: Context) {
SettingDialog(context).show()
try {
SettingDialog(context).show()
} catch (e: Resources.NotFoundException) {
AlertDialog.Builder(context)
.setTitle("需要重启")
.setMessage("哔哩漫游更新了")
.setPositiveButton("重启") { _, _ ->
restartApplication(context as Activity)
}.show()
}
}

const val SPLASH_SELECTION = 0
Expand Down

0 comments on commit f9976aa

Please sign in to comment.