|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.preference.Preference
android.preference.RingtonePreference
public class RingtonePreference
The RingtonePreference allows the user to choose one from all of the
available ringtones. The chosen ringtone's URI will be persisted as a string.
If the user chooses the "Default" item, the saved string will be one of
Settings.System.DEFAULT_RINGTONE_URI or
Settings.System.DEFAULT_NOTIFICATION_URI. If the user chooses the "Silent"
item, the saved string will be an empty string.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.preference.Preference |
|---|
Preference.BaseSavedState, Preference.OnPreferenceChangeInternalListener, Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener |
| Field Summary |
|---|
| Fields inherited from class android.preference.Preference |
|---|
DEFAULT_ORDER |
| Constructor Summary | |
|---|---|
RingtonePreference(Context context)
|
|
RingtonePreference(Context context,
AttributeSet attrs)
|
|
RingtonePreference(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
int |
getRingtoneType()
Returns the sound type(s) that are shown in the picker. |
boolean |
getShowDefault()
Returns whether to a show an item for the default sound/ringtone. |
boolean |
getShowSilent()
Returns whether to a show an item for 'Silent'. |
boolean |
onActivityResult(int requestCode,
int resultCode,
Intent data)
See Activity's onActivityResult. |
protected void |
onAttachedToHierarchy(PreferenceManager preferenceManager)
Called when this preference has been attached to a preference hierarchy. |
protected void |
onClick()
Processes a click on the preference. |
protected Object |
onGetDefaultValue(TypedArray a,
int index)
Called when Preference is being inflated and the default value
attribute needs to be read. |
protected void |
onPrepareRingtonePickerIntent(Intent ringtonePickerIntent)
Prepares the intent to launch the ringtone picker. |
protected Uri |
onRestoreRingtone()
Called when the chooser is about to be shown and the current ringtone should be marked. |
protected void |
onSaveRingtone(Uri ringtoneUri)
Called when a ringtone is chosen. |
protected void |
onSetInitialValue(boolean restorePersistedValue,
Object defaultValueObj)
Implement this to set the initial value of the Preference. |
void |
setRingtoneType(int type)
Sets the sound type(s) that are shown in the picker. |
void |
setShowDefault(boolean showDefault)
Sets whether to show an item for the default sound/ringtone. |
void |
setShowSilent(boolean showSilent)
Sets whether to show an item for 'Silent'. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RingtonePreference(Context context,
AttributeSet attrs,
int defStyle)
public RingtonePreference(Context context,
AttributeSet attrs)
public RingtonePreference(Context context)
| Method Detail |
|---|
public int getRingtoneType()
setRingtoneType(int)public void setRingtoneType(int type)
type - The sound type(s) that are shown in the picker.RingtoneManager.EXTRA_RINGTONE_TYPEpublic boolean getShowDefault()
public void setShowDefault(boolean showDefault)
showDefault - Whether to show the default or not.RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULTpublic boolean getShowSilent()
public void setShowSilent(boolean showSilent)
showSilent - Whether to show 'Silent'.RingtoneManager.EXTRA_RINGTONE_SHOW_SILENTprotected void onClick()
PreferenceSharedPreferences. However, the overridden method should
call Preference.callChangeListener(Object) to make sure the client wants to
update the preference's state with the new value.
onClick in class Preferenceprotected void onPrepareRingtonePickerIntent(Intent ringtonePickerIntent)
ringtonePickerIntent - The ringtone picker intent that can be
modified by putting extras.protected void onSaveRingtone(Uri ringtoneUri)
By default, this saves the ringtone URI to the persistent storage as a string.
ringtoneUri - The chosen ringtone's Uri. Can be null.protected Uri onRestoreRingtone()
By default, this restores the previous ringtone URI from the persistent storage.
protected Object onGetDefaultValue(TypedArray a,
int index)
PreferencePreference is being inflated and the default value
attribute needs to be read. Since different preference types have
different value types, the subclass should get and return the default
value which will be its value type.
For example, if the value type is String, the body of the method would
proxy to TypedArray.getString(int).
onGetDefaultValue in class Preferencea - The set of attributes.index - The index of the default value attribute.
protected void onSetInitialValue(boolean restorePersistedValue,
Object defaultValueObj)
PreferencePreference.shouldPersist()) to defaultValue.
This may not always be called. One example is if it should not persist but there is no default value given.
onSetInitialValue in class PreferencerestorePersistedValue - Whether to restore the persisted value
(true), or use the given default value (false).defaultValueObj - The default value. Only use if restoreValue is false.protected void onAttachedToHierarchy(PreferenceManager preferenceManager)
Preference
onAttachedToHierarchy in class PreferencepreferenceManager - The preference manager of the hierarchy.
public boolean onActivityResult(int requestCode,
int resultCode,
Intent data)
PreferenceManager.OnActivityResultListener
onActivityResult in interface PreferenceManager.OnActivityResultListener
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||