<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум Александра Климова — Сохраняем настройки]]></title>
	<link rel="self" href="http://forum.alexanderklimov.ru/extern.php?action=feed&amp;tid=27&amp;type=atom" />
	<updated>2019-11-08T19:24:48Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.alexanderklimov.ru/viewtopic.php?id=27</id>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1167#p1167" />
			<content type="html"><![CDATA[<p>Я встречал несколько вариантов, все они немножко костыли. Например, переводить число в строку, а потом опять из строки делать число. Видел вариант, когда наследовались от SharedPreferences и создавали свой класс с поддержкой double. Еще были какие-то варианты.</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-11-08T19:24:48Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1167#p1167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1166#p1166" />
			<content type="html"><![CDATA[<p>Здравствуйте, подскажите&nbsp; как быть со значениями double? Как их сохранить?</p>]]></content>
			<author>
				<name><![CDATA[njbots]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1998</uri>
			</author>
			<updated>2019-11-08T07:59:47Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1166#p1166</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1117#p1117" />
			<content type="html"><![CDATA[<p>Смотрите свой код, который удаляет данные. Гадать можно до бесконечности.</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2018-09-11T09:39:31Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1117#p1117</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1116#p1116" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alexander.klimoff wrote:</cite><blockquote><p>Настройки не стираются. Скорее всего у вас неправильно написано приложение, которое самое стирает данные.</p></blockquote></div><p>На что тогда следует обратить внимание в программе? Что может быть написано или настроено не так?</p>]]></content>
			<author>
				<name><![CDATA[ciktaa]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1745</uri>
			</author>
			<updated>2018-09-11T02:46:09Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1116#p1116</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1115#p1115" />
			<content type="html"><![CDATA[<p>Настройки не стираются. Скорее всего у вас неправильно написано приложение, которое самое стирает данные.</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2018-09-10T10:13:58Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1115#p1115</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1114#p1114" />
			<content type="html"><![CDATA[<p>А как избавиться от того что при каждом обновлении приложения из play market эти настройки стираются. </p><p>Т.е. поясню: Человек устанавливает моё приложение и настраивает как ему необходимо, затем я делаю новую версию и выкладываю в play market и когда он обновляет приложение ему приходится настраивать всё заново.</p>]]></content>
			<author>
				<name><![CDATA[ciktaa]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1745</uri>
			</author>
			<updated>2018-09-10T09:32:06Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1114#p1114</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1102#p1102" />
			<content type="html"><![CDATA[<p>Здравствуйте! Как лучше сохранить логин-пароль для автоматической авторизации на разных сайтах? Подгружать в Intent?</p>]]></content>
			<author>
				<name><![CDATA[sagamor]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1651</uri>
			</author>
			<updated>2018-05-07T16:30:37Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1102#p1102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1052#p1052" />
			<content type="html"><![CDATA[<p>Возьмите и проверьте. Зачем спрашивать.</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2018-01-24T10:44:24Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1052#p1052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=1048#p1048" />
			<content type="html"><![CDATA[<p>Как-то скажется на работе программы, если я буду просто получать значение без проверки на наличие ключа?</p>]]></content>
			<author>
				<name><![CDATA[Mikhail]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1572</uri>
			</author>
			<updated>2018-01-23T05:48:13Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=1048#p1048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=860#p860" />
			<content type="html"><![CDATA[<p>Файл настроек - это файл с известным путем и именем. Поэтому можно проверить и его наличие и удалить. Но нужно ли это?</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2017-08-01T18:59:21Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=860#p860</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=859#p859" />
			<content type="html"><![CDATA[<p>забавно ощущать себя некропостером, но раз уж...</p><p>в общем вопрос — а есть ли возможность определить принципиальное наличие файла настроек?<br />как я понял команда<br /></p><div class="codebox"><pre><code> mSettings = getSharedPreferences(APP_PREFERENCES, Context.MODE_PRIVATE);</code></pre></div><p>при отсутствии файла сразу его создаёт? а если мне нужно только узнать есть этот файл или нет? то как?</p><p>ну и за компанию — а удалить файл настроек можно? <img src="http://forum.alexanderklimov.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[boss_soft]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1486</uri>
			</author>
			<updated>2017-08-01T11:59:34Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=859#p859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=562#p562" />
			<content type="html"><![CDATA[<p>SharedPreferences - это по сути чтение и запись в файл. Не имеет значения, из какой активности вы будете обращаться к файлу - он общий для всех активностей. Поэтому, точно также создаете экземпляр класса SharedPreferences и считываете нужные настройки.</p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2016-06-28T18:44:46Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=562#p562</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=561#p561" />
			<content type="html"><![CDATA[<p>Добрый день!<br />Вопрос - где лучше всего читать настройки?<br />У меня есть активити Settings, там я меняю/сохраняю настройки приложения.<br />Настройки хранятся в SharedPreferences.<br />Но эти настройки мне нужны в MainActivity.<br />Вопрос:<br />Чтение настроек в каждой активности делать свое или сделать общий класс и к нему обращаться или использовать класс Settings где у меня уже есть чтение настроек.<br />И как вызвать процедуру, которая читает настройки в SettingsActivity из MainActivity?</p><p>В public class Setting extends AppCompatActivity у меня есть процедура</p><div class="codebox"><pre><code>public void readSetting() {

        mSettings = getSharedPreferences(APP_PREFERENCES, Context.MODE_PRIVATE);
        Switch vibra_switch = (Switch) findViewById(R.id.vibra_switch);
        Switch sound_switch = (Switch) findViewById(R.id.sound_switch);
        Switch toast_switch = (Switch) findViewById(R.id.toast_switch);

        vibra_switch.setChecked(mSettings.getBoolean(APP_PREFERENCES_Vibra, true));
        sound_switch.setChecked(mSettings.getBoolean(APP_PREFERENCES_Sound, true));
        toast_switch.setChecked(mSettings.getBoolean(APP_PREFERENCES_Toast, true));

    }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Djoin]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=1334</uri>
			</author>
			<updated>2016-06-28T13:22:51Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=561#p561</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Сохраняем настройки]]></title>
			<link rel="alternate" href="http://forum.alexanderklimov.ru/viewtopic.php?pid=374#p374" />
			<content type="html"><![CDATA[<p>Обсуждение статьи <a href="http://developer.alexanderklimov.ru/android/preference.php">Сохраняем настройки</a></p>]]></content>
			<author>
				<name><![CDATA[alexander.klimoff]]></name>
				<uri>http://forum.alexanderklimov.ru/profile.php?id=2</uri>
			</author>
			<updated>2016-02-13T12:44:43Z</updated>
			<id>http://forum.alexanderklimov.ru/viewtopic.php?pid=374#p374</id>
		</entry>
</feed>
