|
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.DialogPreference
public abstract class DialogPreference
The DialogPreference class is a base class for preferences that are
dialog-based. These preferences will, when clicked, open a dialog showing the
actual preference controls.
| 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 | |
|---|---|
DialogPreference(Context context,
AttributeSet attrs)
|
|
DialogPreference(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
Drawable |
getDialogIcon()
Returns the icon to be shown on subsequent dialogs. |
int |
getDialogLayoutResource()
Returns the layout resource that is used as the content View for subsequent dialogs. |
CharSequence |
getDialogMessage()
Returns the message to be shown on subsequent dialogs. |
CharSequence |
getDialogTitle()
Returns the title to be shown on subsequent dialogs. |
CharSequence |
getNegativeButtonText()
Returns the text of the negative button to be shown on subsequent dialogs. |
CharSequence |
getPositiveButtonText()
Returns the text of the positive button to be shown on subsequent dialogs. |
void |
onActivityDestroy()
See Activity's onDestroy. |
protected void |
onBindDialogView(View view)
Binds views in the content View of the dialog to data. |
protected void |
onClick()
Processes a click on the preference. |
void |
onClick(DialogInterface dialog,
int which)
This method will be invoked when a button in the dialog is clicked. |
protected View |
onCreateDialogView()
Creates the content view for the dialog (if a custom content view is required). |
protected void |
onDialogClosed(boolean positiveResult)
Called when the dialog is dismissed and should be used to save data to the SharedPreferences. |
void |
onDismiss(DialogInterface dialog)
This method will be invoked when the dialog is dismissed. |
protected void |
onPrepareDialogBuilder(AlertDialog.Builder builder)
Prepares the dialog builder to be shown when the preference is clicked. |
protected void |
onRestoreInstanceState(Parcelable state)
Hook allowing a preference to re-apply a representation of its internal state that had previously been generated by Preference.onSaveInstanceState(). |
protected Parcelable |
onSaveInstanceState()
Hook allowing a preference to generate a representation of its internal state that can later be used to create a new instance with that same state. |
void |
setDialogIcon(Drawable dialogIcon)
Sets the icon of the dialog. |
void |
setDialogIcon(int dialogIconRes)
Sets the icon (resource ID) of the dialog. |
void |
setDialogLayoutResource(int dialogLayoutResId)
Sets the layout resource that is inflated as the View to be shown
as the content View of subsequent dialogs. |
void |
setDialogMessage(CharSequence dialogMessage)
Sets the message of the dialog. |
void |
setDialogMessage(int dialogMessageResId)
|
void |
setDialogTitle(CharSequence dialogTitle)
Sets the title of the dialog. |
void |
setDialogTitle(int dialogTitleResId)
|
void |
setNegativeButtonText(CharSequence negativeButtonText)
Sets the text of the negative button of the dialog. |
void |
setNegativeButtonText(int negativeButtonTextResId)
|
void |
setPositiveButtonText(CharSequence positiveButtonText)
Sets the text of the positive button of the dialog. |
void |
setPositiveButtonText(int positiveButtonTextResId)
|
protected void |
showDialog(Bundle state)
Shows the dialog associated with this Preference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DialogPreference(Context context,
AttributeSet attrs,
int defStyle)
public DialogPreference(Context context,
AttributeSet attrs)
| Method Detail |
|---|
public void setDialogTitle(CharSequence dialogTitle)
dialogTitle - The title.public void setDialogTitle(int dialogTitleResId)
dialogTitleResId - The dialog title as a resource.setDialogTitle(CharSequence)public CharSequence getDialogTitle()
public void setDialogMessage(CharSequence dialogMessage)
This message forms the content View of the dialog and conflicts with
list-based dialogs, for example. If setting a custom View on a dialog via
setDialogLayoutResource(int), include a text View with ID
R.id.message and it will be populated with this message.
dialogMessage - The message.public void setDialogMessage(int dialogMessageResId)
dialogMessageResId - The dialog message as a resource.setDialogMessage(CharSequence)public CharSequence getDialogMessage()
public void setDialogIcon(Drawable dialogIcon)
dialogIcon - The icon, as a Drawable.public void setDialogIcon(int dialogIconRes)
dialogIconRes - The icon, as a resource ID.public Drawable getDialogIcon()
Drawable.public void setPositiveButtonText(CharSequence positiveButtonText)
positiveButtonText - The text of the positive button.public void setPositiveButtonText(int positiveButtonTextResId)
positiveButtonTextResId - The positive button text as a resource.setPositiveButtonText(CharSequence)public CharSequence getPositiveButtonText()
public void setNegativeButtonText(CharSequence negativeButtonText)
negativeButtonText - The text of the negative button.public void setNegativeButtonText(int negativeButtonTextResId)
negativeButtonTextResId - The negative button text as a resource.setNegativeButtonText(CharSequence)public CharSequence getNegativeButtonText()
public void setDialogLayoutResource(int dialogLayoutResId)
View to be shown
as the content View of subsequent dialogs.
dialogLayoutResId - The layout resource ID to be inflated.setDialogMessage(CharSequence)public int getDialogLayoutResource()
protected void onPrepareDialogBuilder(AlertDialog.Builder builder)
Do not AlertDialog.Builder#create() or
AlertDialog.Builder#show().
protected 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 showDialog(Bundle state)
state - Optional instance state to restore on the dialogprotected View onCreateDialogView()
Preference.setLayoutResource(int)protected void onBindDialogView(View view)
Make sure to call through to the superclass implementation.
view - The content View of the dialog, if it is custom.
public void onClick(DialogInterface dialog,
int which)
DialogInterface.OnClickListener
onClick in interface DialogInterface.OnClickListenerdialog - The dialog that received the click.which - The button that was clicked, i.e. BUTTON1 or BUTTON2 or
the position of the item clicked.public void onDismiss(DialogInterface dialog)
DialogInterface.OnDismissListener
onDismiss in interface DialogInterface.OnDismissListenerdialog - The dialog that was dismissed will be passed into the
method.protected void onDialogClosed(boolean positiveResult)
SharedPreferences.
positiveResult - Whether the positive button was clicked (true), or
the negative button was clicked or the dialog was canceled (false).public void onActivityDestroy()
onActivityDestroy in interface PreferenceManager.OnActivityDestroyListenerprotected Parcelable onSaveInstanceState()
Preference
onSaveInstanceState in class PreferencePreference.onRestoreInstanceState(android.os.Parcelable),
Preference.saveHierarchyState(android.os.Bundle),
Preference.dispatchSaveInstanceState(android.os.Bundle)protected void onRestoreInstanceState(Parcelable state)
PreferencePreference.onSaveInstanceState().
This function will never be called with a null icicle.
onRestoreInstanceState in class Preferencestate - The frozen state that had previously been returned by
Preference.onSaveInstanceState().Preference.onSaveInstanceState(),
Preference.restoreHierarchyState(android.os.Bundle),
Preference.dispatchRestoreInstanceState(android.os.Bundle)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||