<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Александра Климова — Preferences Framework]]></title>
		<link>http://forum.alexanderklimov.ru/viewtopic.php?id=28</link>
		<atom:link href="http://forum.alexanderklimov.ru/extern.php?action=feed&amp;tid=28&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Preferences Framework.]]></description>
		<lastBuildDate>Fri, 16 Jun 2017 17:37:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=841#p841</link>
			<description><![CDATA[<p>Похоже в статью затесался лишний абзац, который относился к другой теме. Удалил.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Fri, 16 Jun 2017 17:37:08 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=841#p841</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=840#p840</link>
			<description><![CDATA[<p>Вконце, где рассказано,как из своей программы запустить стандартные настройки, вопрос касательно фильтра</p><p>&lt;activity android:name=&quot;Prefs&quot; &gt;<br />&nbsp; &nbsp; &lt;intent-filter&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;action android:name=&quot;ru.alexanderklimov.preferences.ACTION_USER_PREFERENCE&quot; /&gt;<br />&nbsp; &nbsp; &lt;/intent-filter&gt;<br />&lt;/activity&gt;</p><p>Так вот, что за имя Prefs, откуда оно берется? Это просто в манифесте мы обзываем так третью активность?<br />И в &quot;ru.alexanderklimov.preferences.ACTION_USER_PREFERENCE&quot; что такое preferences? Судя по другим примерам кода в упражнении, приложение у вас называется по-другому. Ну даже если сюда вписывается название приложения, у меня при попытке запустить стандартную настройку выкидывает ошибку <img src="http://forum.alexanderklimov.ru/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></description>
			<author><![CDATA[null@example.com (aptem4ka)]]></author>
			<pubDate>Fri, 16 Jun 2017 13:23:43 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=840#p840</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=799#p799</link>
			<description><![CDATA[<p>А где можно поподробнее узнать про OnSharedPreferenceChangeListener? С ним два вопроса появились:</p><p>1) Как написано в уроке обработчик зарегистрировать не получается. Студия не согласна принимать &quot;this&quot; аргументом в &quot;registerOnSharedPreferenceChangeListener()&quot;. Сделал так, через переменную &quot;listener&quot;:<br /></p><div class="codebox"><pre><code>    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mEditText = (EditText)findViewById(R.id.editText);

        Context context = getApplicationContext();
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.OnSharedPreferenceChangeListener listener = (new SharedPreferences.OnSharedPreferenceChangeListener() {
            @Override
            public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
                if (key.equals(&quot;cat_food&quot;)) {
                    String catFood = sharedPreferences.getString(key, &quot;&quot;);
                    catFood = catFood + &quot;\n&quot;;

                    String myText = mEditText.getText().toString();
                    Toast.makeText(getApplicationContext(), myText, Toast.LENGTH_SHORT).show();
                    myText = myText + catFood;
                    Toast.makeText(getApplicationContext(), myText, Toast.LENGTH_SHORT).show();
                    mEditText.setText(myText);
                    Toast.makeText(getApplicationContext(), mEditText.getText().toString(), Toast.LENGTH_SHORT).show();
                }
            }
        });
        sharedPreferences.registerOnSharedPreferenceChangeListener(listener);
    }</code></pre></div><p>2) Пытаюсь с его помощью &quot;Проверять общие настройки, ключевые параметры и изменять UI или поведение приложения, если потребуется.&quot; <img src="http://forum.alexanderklimov.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />В этом же коде - добавлять к тексту указанный в настройках подарок коту. Все тосты выводят все правильно, но текст в mEditText в главной активности не изменяется... Его надо как-то пнуть, чтобы обновился?</p>]]></description>
			<author><![CDATA[null@example.com (NeferSky)]]></author>
			<pubDate>Tue, 18 Apr 2017 11:49:46 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=799#p799</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=489#p489</link>
			<description><![CDATA[<p>Возможно для выделения требуется какой-то стиль. Я давно не пользовался и подсказать не могу.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Sun, 10 Apr 2016 14:45:28 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=489#p489</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=485#p485</link>
			<description><![CDATA[<p>Здравствуйте!<br />В &lt;ListPreference&gt; при первом запуске ничего не выделено. Я думал&nbsp; android:defaultValue=&quot;1&quot; должен был задать второй элемент списка. Или я не прав и параметр только говорит значение по умолчанию, но не выделяет в самом списке?</p>]]></description>
			<author><![CDATA[null@example.com (Ant118)]]></author>
			<pubDate>Thu, 07 Apr 2016 19:28:27 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=485#p485</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=411#p411</link>
			<description><![CDATA[<p>В Android 4 использовался ActionBar, в 5 версии используют Toolbar. ActionBar уходит в прошлое.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Fri, 04 Mar 2016 06:19:06 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=411#p411</guid>
		</item>
		<item>
			<title><![CDATA[Re: Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=410#p410</link>
			<description><![CDATA[<p>У вас на скриншотах присутствует actionbar, но если делать по гайду - он отсутствует(Андроид 5.1), почему?</p>]]></description>
			<author><![CDATA[null@example.com (Nick)]]></author>
			<pubDate>Thu, 03 Mar 2016 20:50:30 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=410#p410</guid>
		</item>
		<item>
			<title><![CDATA[Preferences Framework]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=387#p387</link>
			<description><![CDATA[<p>Обсуждение статьи <a href="http://developer.alexanderklimov.ru/android/preferences_framework.php">Preferences Framework</a></p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Thu, 18 Feb 2016 17:06:27 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=387#p387</guid>
		</item>
	</channel>
</rss>
