diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 49c35b59..da93cb1e 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="80" + android:versionName="2.4.0"> diff --git a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala index fa4a82c9..976da9ba 100644 --- a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala +++ b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala @@ -128,7 +128,11 @@ object Shadowsocks { // Helper functions def updateListPreference(pref: Preference, value: String) { pref.asInstanceOf[ListPreference].setValue(value) - pref.setSummary(pref.asInstanceOf[ListPreference].getEntry) + val entry = pref.asInstanceOf[ListPreference].getEntry + if (entry != null) + pref.setSummary(entry) + else + pref.setSummary(value) } def updatePasswordEditTextPreference(pref: Preference, value: String) { diff --git a/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala b/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala index f1007766..c45c704d 100644 --- a/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala +++ b/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala @@ -48,7 +48,11 @@ class SummaryListPreference(context: Context, attrs: AttributeSet) override def setValue(text: String) { super.setValue(text) - setSummary(getEntry) + val entry = getEntry + if (entry != null) + setSummary(entry) + else + setSummary(text) } override def setSummary(summary: CharSequence) {