diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-22 11:00:13 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-22 11:00:13 +0200 |
commit | c2bc15f5bacd636d3a6ffefe43c057022018e1d2 (patch) | |
tree | fa7f539189d2c83234634040ee0f37af3c309edc /src/eu/siacs/conversations | |
parent | 1f91ed11fa1c9b73c4b57c7ed3b28985840fe002 (diff) |
added 'model' to selectable resources. fixed #461
Diffstat (limited to 'src/eu/siacs/conversations')
-rw-r--r-- | src/eu/siacs/conversations/ui/SettingsActivity.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/ui/SettingsActivity.java b/src/eu/siacs/conversations/ui/SettingsActivity.java index c522e058..fc361fb8 100644 --- a/src/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/eu/siacs/conversations/ui/SettingsActivity.java @@ -1,20 +1,27 @@ package eu.siacs.conversations.ui; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Locale; import eu.siacs.conversations.entities.Account; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; +import android.os.Build; import android.os.Bundle; +import android.preference.ListPreference; import android.preference.PreferenceManager; public class SettingsActivity extends XmppActivity implements OnSharedPreferenceChangeListener { + private SettingsFragment mSettingsFragment; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + mSettingsFragment = new SettingsFragment(); getFragmentManager().beginTransaction() - .replace(android.R.id.content, new SettingsFragment()).commit(); + .replace(android.R.id.content,mSettingsFragment).commit(); } @Override @@ -27,6 +34,13 @@ public class SettingsActivity extends XmppActivity implements super.onStart(); PreferenceManager.getDefaultSharedPreferences(this) .registerOnSharedPreferenceChangeListener(this); + ListPreference resources = (ListPreference) mSettingsFragment.findPreference("resource"); + if (resources!=null) { + ArrayList<CharSequence> entries = new ArrayList<CharSequence>(Arrays.asList(resources.getEntries())); + entries.add(0,Build.MODEL); + resources.setEntries(entries.toArray(new CharSequence[entries.size()])); + resources.setEntryValues(entries.toArray(new CharSequence[entries.size()])); + } } @Override |