fix a bug
This commit is contained in:
@@ -128,11 +128,6 @@ object Shadowsocks {
|
||||
// Helper functions
|
||||
def updateListPreference(pref: Preference, value: String) {
|
||||
pref.asInstanceOf[ListPreference].setValue(value)
|
||||
val entry = pref.asInstanceOf[ListPreference].getEntry
|
||||
if (entry != null)
|
||||
pref.setSummary(entry)
|
||||
else
|
||||
pref.setSummary(value)
|
||||
}
|
||||
|
||||
def updatePasswordEditTextPreference(pref: Preference, value: String) {
|
||||
|
||||
@@ -56,7 +56,7 @@ class SummaryListPreference(context: Context, attrs: AttributeSet)
|
||||
}
|
||||
|
||||
override def setSummary(summary: CharSequence) {
|
||||
if (summary.toString.isEmpty) {
|
||||
if (summary == null || summary.toString.isEmpty) {
|
||||
super.setSummary("")
|
||||
} else {
|
||||
super.setSummary(summary)
|
||||
|
||||
Reference in New Issue
Block a user