You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tasks/com/todoroo/andlib/utility/Preferences.html

714 lines
26 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Dec 22 20:39:06 PST 2011 -->
<TITLE>
Preferences
</TITLE>
<META NAME="date" CONTENT="2011-12-22">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Preferences";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Preferences.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/todoroo/andlib/utility/Pair.html" title="class in com.todoroo.andlib.utility"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/todoroo/andlib/utility/TodorooPreferenceActivity.html" title="class in com.todoroo.andlib.utility"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/todoroo/andlib/utility/Preferences.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Preferences.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.todoroo.andlib.utility</FONT>
<BR>
Class Preferences</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.todoroo.andlib.utility.Preferences</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Preferences</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Helper class for reading and writing SharedPreferences
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Tim Su <tim@todoroo.com></DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#Preferences()">Preferences</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#clear(java.lang.String)">clear</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clears a preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getBoolean(int, boolean)">getBoolean</A></B>(int&nbsp;keyResources,
boolean&nbsp;defValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a boolean preference (e.g.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getBoolean(java.lang.String, boolean)">getBoolean</A></B>(java.lang.String&nbsp;key,
boolean&nbsp;defValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a boolean preference (e.g.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.Float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getFloatFromString(int)">getFloatFromString</A></B>(int&nbsp;keyResource)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets an float value from a string preference.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getInt(java.lang.String, int)">getInt</A></B>(java.lang.String&nbsp;key,
int&nbsp;defValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a int preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getIntegerFromString(int, int)">getIntegerFromString</A></B>(int&nbsp;keyResource,
int&nbsp;defaultValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets an integer value from a string preference.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getLong(java.lang.String, long)">getLong</A></B>(java.lang.String&nbsp;key,
long&nbsp;defValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a long preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;android.content.SharedPreferences</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getPrefs(android.content.Context)">getPrefs</A></B>(android.content.Context&nbsp;context)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get preferences object from the context</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getStringValue(int)">getStringValue</A></B>(int&nbsp;keyResource)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets an string value from a string preference.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#getStringValue(java.lang.String)">getStringValue</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets an string value from a string preference.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#isSet(java.lang.String)">isSet</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setBoolean(int, boolean)">setBoolean</A></B>(int&nbsp;keyResource,
boolean&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets boolean preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setBoolean(java.lang.String, boolean)">setBoolean</A></B>(java.lang.String&nbsp;key,
boolean&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets boolean preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setIfUnset(android.content.SharedPreferences, android.content.SharedPreferences.Editor, android.content.res.Resources, int, boolean)">setIfUnset</A></B>(android.content.SharedPreferences&nbsp;prefs,
android.content.SharedPreferences.Editor&nbsp;editor,
android.content.res.Resources&nbsp;r,
int&nbsp;keyResource,
boolean&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Helper to write to editor if key specified is null</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setIfUnset(android.content.SharedPreferences, android.content.SharedPreferences.Editor, android.content.res.Resources, int, int)">setIfUnset</A></B>(android.content.SharedPreferences&nbsp;prefs,
android.content.SharedPreferences.Editor&nbsp;editor,
android.content.res.Resources&nbsp;r,
int&nbsp;keyResource,
int&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Helper to write to editor if key specified is null.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setInt(java.lang.String, int)">setInt</A></B>(java.lang.String&nbsp;key,
int&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets int preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setLong(java.lang.String, long)">setLong</A></B>(java.lang.String&nbsp;key,
long&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets long preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setString(int, java.lang.String)">setString</A></B>(int&nbsp;keyResource,
java.lang.String&nbsp;newValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets string preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setString(java.lang.String, java.lang.String)">setString</A></B>(java.lang.String&nbsp;key,
java.lang.String&nbsp;newValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets string preference</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/todoroo/andlib/utility/Preferences.html#setStringFromInteger(int, int)">setStringFromInteger</A></B>(int&nbsp;keyResource,
int&nbsp;newValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets string preference from integer value</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Preferences()"><!-- --></A><H3>
Preferences</H3>
<PRE>
public <B>Preferences</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setIfUnset(android.content.SharedPreferences, android.content.SharedPreferences.Editor, android.content.res.Resources, int, int)"><!-- --></A><H3>
setIfUnset</H3>
<PRE>
public static void <B>setIfUnset</B>(android.content.SharedPreferences&nbsp;prefs,
android.content.SharedPreferences.Editor&nbsp;editor,
android.content.res.Resources&nbsp;r,
int&nbsp;keyResource,
int&nbsp;value)</PRE>
<DL>
<DD>Helper to write to editor if key specified is null. Writes a String
property with the given integer
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>prefs</CODE> - <DD><CODE>editor</CODE> - <DD><CODE>r</CODE> - <DD><CODE>keyResource</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="setIfUnset(android.content.SharedPreferences, android.content.SharedPreferences.Editor, android.content.res.Resources, int, boolean)"><!-- --></A><H3>
setIfUnset</H3>
<PRE>
public static void <B>setIfUnset</B>(android.content.SharedPreferences&nbsp;prefs,
android.content.SharedPreferences.Editor&nbsp;editor,
android.content.res.Resources&nbsp;r,
int&nbsp;keyResource,
boolean&nbsp;value)</PRE>
<DL>
<DD>Helper to write to editor if key specified is null
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>prefs</CODE> - <DD><CODE>editor</CODE> - <DD><CODE>r</CODE> - <DD><CODE>keyResource</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="getPrefs(android.content.Context)"><!-- --></A><H3>
getPrefs</H3>
<PRE>
public static android.content.SharedPreferences <B>getPrefs</B>(android.content.Context&nbsp;context)</PRE>
<DL>
<DD>Get preferences object from the context
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isSet(java.lang.String)"><!-- --></A><H3>
isSet</H3>
<PRE>
public static boolean <B>isSet</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>true if given preference is set</DL>
</DD>
</DL>
<HR>
<A NAME="getStringValue(java.lang.String)"><!-- --></A><H3>
getStringValue</H3>
<PRE>
public static java.lang.String <B>getStringValue</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD>Gets an string value from a string preference. Returns null
if the value is not set
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - <DD><CODE>key</CODE> -
<DT><B>Returns:</B><DD>integer value, or null on error</DL>
</DD>
</DL>
<HR>
<A NAME="getStringValue(int)"><!-- --></A><H3>
getStringValue</H3>
<PRE>
public static java.lang.String <B>getStringValue</B>(int&nbsp;keyResource)</PRE>
<DL>
<DD>Gets an string value from a string preference. Returns null
if the value is not set
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - <DD><CODE>key</CODE> -
<DT><B>Returns:</B><DD>integer value, or null on error</DL>
</DD>
</DL>
<HR>
<A NAME="getIntegerFromString(int, int)"><!-- --></A><H3>
getIntegerFromString</H3>
<PRE>
public static int <B>getIntegerFromString</B>(int&nbsp;keyResource,
int&nbsp;defaultValue)</PRE>
<DL>
<DD>Gets an integer value from a string preference. Returns null
if the value is not set or not an integer.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>keyResource</CODE> - resource from string.xml
<DT><B>Returns:</B><DD>integer value, or null on error</DL>
</DD>
</DL>
<HR>
<A NAME="getFloatFromString(int)"><!-- --></A><H3>
getFloatFromString</H3>
<PRE>
public static java.lang.Float <B>getFloatFromString</B>(int&nbsp;keyResource)</PRE>
<DL>
<DD>Gets an float value from a string preference. Returns null
if the value is not set or not an flat.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>keyResource</CODE> - resource from string.xml
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="setString(int, java.lang.String)"><!-- --></A><H3>
setString</H3>
<PRE>
public static void <B>setString</B>(int&nbsp;keyResource,
java.lang.String&nbsp;newValue)</PRE>
<DL>
<DD>Sets string preference
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setString(java.lang.String, java.lang.String)"><!-- --></A><H3>
setString</H3>
<PRE>
public static void <B>setString</B>(java.lang.String&nbsp;key,
java.lang.String&nbsp;newValue)</PRE>
<DL>
<DD>Sets string preference
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setStringFromInteger(int, int)"><!-- --></A><H3>
setStringFromInteger</H3>
<PRE>
public static void <B>setStringFromInteger</B>(int&nbsp;keyResource,
int&nbsp;newValue)</PRE>
<DL>
<DD>Sets string preference from integer value
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getBoolean(java.lang.String, boolean)"><!-- --></A><H3>
getBoolean</H3>
<PRE>
public static boolean <B>getBoolean</B>(java.lang.String&nbsp;key,
boolean&nbsp;defValue)</PRE>
<DL>
<DD>Gets a boolean preference (e.g. a CheckBoxPreference setting)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>defValue</CODE> -
<DT><B>Returns:</B><DD>default if value is unset otherwise the value</DL>
</DD>
</DL>
<HR>
<A NAME="getBoolean(int, boolean)"><!-- --></A><H3>
getBoolean</H3>
<PRE>
public static boolean <B>getBoolean</B>(int&nbsp;keyResources,
boolean&nbsp;defValue)</PRE>
<DL>
<DD>Gets a boolean preference (e.g. a CheckBoxPreference setting)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>keyResource</CODE> - <DD><CODE>defValue</CODE> -
<DT><B>Returns:</B><DD>default if value is unset otherwise the value</DL>
</DD>
</DL>
<HR>
<A NAME="setBoolean(int, boolean)"><!-- --></A><H3>
setBoolean</H3>
<PRE>
public static void <B>setBoolean</B>(int&nbsp;keyResource,
boolean&nbsp;value)</PRE>
<DL>
<DD>Sets boolean preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="setBoolean(java.lang.String, boolean)"><!-- --></A><H3>
setBoolean</H3>
<PRE>
public static void <B>setBoolean</B>(java.lang.String&nbsp;key,
boolean&nbsp;value)</PRE>
<DL>
<DD>Sets boolean preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="getInt(java.lang.String, int)"><!-- --></A><H3>
getInt</H3>
<PRE>
public static int <B>getInt</B>(java.lang.String&nbsp;key,
int&nbsp;defValue)</PRE>
<DL>
<DD>Gets a int preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>defValue</CODE> -
<DT><B>Returns:</B><DD>default if value is unset otherwise the value</DL>
</DD>
</DL>
<HR>
<A NAME="setInt(java.lang.String, int)"><!-- --></A><H3>
setInt</H3>
<PRE>
public static void <B>setInt</B>(java.lang.String&nbsp;key,
int&nbsp;value)</PRE>
<DL>
<DD>Sets int preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="getLong(java.lang.String, long)"><!-- --></A><H3>
getLong</H3>
<PRE>
public static long <B>getLong</B>(java.lang.String&nbsp;key,
long&nbsp;defValue)</PRE>
<DL>
<DD>Gets a long preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>defValue</CODE> -
<DT><B>Returns:</B><DD>default if value is unset otherwise the value</DL>
</DD>
</DL>
<HR>
<A NAME="setLong(java.lang.String, long)"><!-- --></A><H3>
setLong</H3>
<PRE>
public static void <B>setLong</B>(java.lang.String&nbsp;key,
long&nbsp;value)</PRE>
<DL>
<DD>Sets long preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - <DD><CODE>value</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="clear(java.lang.String)"><!-- --></A><H3>
clear</H3>
<PRE>
public static void <B>clear</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD>Clears a preference
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - </DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Preferences.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/todoroo/andlib/utility/Pair.html" title="class in com.todoroo.andlib.utility"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/todoroo/andlib/utility/TodorooPreferenceActivity.html" title="class in com.todoroo.andlib.utility"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/todoroo/andlib/utility/Preferences.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Preferences.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>