[Android] PreferencesActivity: remove unnecessary EditTextPreference

Edward Wang git at videolan.org
Sat Nov 17 21:37:22 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Nov 17 15:25:02 2012 -0500| [c5b758109f811877bdbb855def6973e2f8d0525b] | committer: Edward Wang

PreferencesActivity: remove unnecessary EditTextPreference

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c5b758109f811877bdbb855def6973e2f8d0525b
---

 vlc-android/res/xml/preferences.xml                           |    5 -----
 vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java |    6 ++++--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/vlc-android/res/xml/preferences.xml b/vlc-android/res/xml/preferences.xml
index 89b3079..6b419df 100644
--- a/vlc-android/res/xml/preferences.xml
+++ b/vlc-android/res/xml/preferences.xml
@@ -84,9 +84,4 @@
         </PreferenceScreen>
     </PreferenceCategory>
 
-    <EditTextPreference
-        android:defaultValue="@string/screen_orientation_default"
-        android:key="screen_orientation_value"
-        android:selectable="false" />
-
 </PreferenceScreen>
diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index ed978a3..991dc54 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -282,8 +282,10 @@ public class PreferencesActivity extends PreferenceActivity {
         screenOrientationPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
             @Override
             public boolean onPreferenceChange(Preference preference, Object newValue) {
-                EditTextPreference screenOrientationValue =  (EditTextPreference) findPreference("screen_orientation_value");
-                screenOrientationValue.setText((String) newValue);
+                final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(PreferencesActivity.this);
+                SharedPreferences.Editor editor = sharedPrefs.edit();
+                editor.putString("screen_orientation_value", (String)newValue);
+                editor.commit();
                 return true;
             }
         });



More information about the Android mailing list