<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Communauté française android news, news du Web et bien d&#039;autres domaines &#187; Listes</title>
	<atom:link href="http://www.android-inside.com/tag/listes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.android-inside.com</link>
	<description>telephones, smart phones android, programmation et applications, news twitter facebook</description>
	<lastBuildDate>Thu, 01 Dec 2011 21:34:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Travailler avec les preferences sous ANDROID</title>
		<link>http://www.android-inside.com/2009/11/travailler-avec-les-preferences-sous-android/</link>
		<comments>http://www.android-inside.com/2009/11/travailler-avec-les-preferences-sous-android/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 18:06:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Listes]]></category>
		<category><![CDATA[preferences]]></category>

		<guid isPermaLink="false">http://www.android-inside.com/wordpress/?p=56</guid>
		<description><![CDATA[comment travailler avec les preferences, sauvegarder des informations sous Android


Related posts:<ol><li><a href='http://www.android-inside.com/2009/11/suite-projet-erathquake-les-preferences/' rel='bookmark' title='Suite projet Erathquake : les preferences'>Suite projet Erathquake : les preferences</a></li>
<li><a href='http://www.android-inside.com/2009/11/earthqauke-suite-du-projet-android/' rel='bookmark' title='Earthquake suite du projet android'>Earthquake suite du projet android</a></li>
<li><a href='http://www.android-inside.com/2009/11/services-sous-android-lecon-1/' rel='bookmark' title='Services sous android Leçon 1'>Services sous android Leçon 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> simplePrefrence <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #000000; font-weight: bold;">implements</span> CompoundButton.<span style="color: #006633;">OnCheckedChangeListener</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span>
&nbsp;
 CheckBox chk<span style="color: #339933;">;</span>
 @Override
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
 <span style="color: #003399;">Button</span> btn <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #003399;">Button</span><span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">button</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 chk <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>CheckBox<span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">checkbox</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 chk.<span style="color: #006633;">setOnCheckedChangeListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 btn.<span style="color: #006633;">setOnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Button</span>.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span> v<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
 <span style="color: #008000; font-style: italic; font-weight: bold;">/**called when Checkbox is checked */</span>
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCheckedChanged<span style="color: #009900;">&#40;</span>CompoundButton cmp, <span style="color: #000066; font-weight: bold;">boolean</span> checked<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>checked<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 chk.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;checked&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
 chk.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onResume<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onResume</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 SharedPreferences  setting <span style="color: #339933;">=</span> getPreferences<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 chk.<span style="color: #006633;">setChecked</span><span style="color: #009900;">&#40;</span> setting.<span style="color: #006633;">getBoolean</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;chk&quot;</span>, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onPause<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onPause</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 SharedPreferences  setting <span style="color: #339933;">=</span> getPreferences<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 SharedPreferences.<span style="color: #006633;">Editor</span>  editor <span style="color: #339933;">=</span> setting.<span style="color: #006633;">edit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 editor.<span style="color: #006633;">putBoolean</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;chk&quot;</span>, chk.<span style="color: #006633;">isChecked</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 editor.<span style="color: #006633;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>Related posts:<ol><li><a href='http://www.android-inside.com/2009/11/suite-projet-erathquake-les-preferences/' rel='bookmark' title='Suite projet Erathquake : les preferences'>Suite projet Erathquake : les preferences</a></li>
<li><a href='http://www.android-inside.com/2009/11/earthqauke-suite-du-projet-android/' rel='bookmark' title='Earthquake suite du projet android'>Earthquake suite du projet android</a></li>
<li><a href='http://www.android-inside.com/2009/11/services-sous-android-lecon-1/' rel='bookmark' title='Services sous android Leçon 1'>Services sous android Leçon 1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.android-inside.com/2009/11/travailler-avec-les-preferences-sous-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
