From a10889bb5ba56b8e7b9f4c5b5b547a818cbe7490 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 21 Nov 2014 12:15:59 +0800 Subject: [PATCH] fix a bug --- src/main/AndroidManifest.xml | 2 -- src/main/res/xml/tracker.xml | 7 ++++++- src/main/scala/com/github/shadowsocks/Shadowsocks.scala | 5 ----- .../shadowsocks/preferences/SummaryListPreference.scala | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index af9d734d..57797b47 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -5,10 +5,8 @@ - - true + + true + Shadowsocks ScreenView + Shadowsocks EcommerceView + UA-37082941-1 - \ No newline at end of file + diff --git a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala index 3cc8c831..ee09ca0c 100644 --- a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala +++ b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala @@ -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) { diff --git a/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala b/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala index c45c704d..4cf92bac 100644 --- a/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala +++ b/src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala @@ -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)