com.facebook.widget
Class WebDialog

java.lang.Object
  extended by android.app.Dialog
      extended by com.facebook.widget.WebDialog
All Implemented Interfaces:
DialogInterface, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback
Direct Known Subclasses:
FbDialog

public class WebDialog
extends Dialog

This class provides a mechanism for displaying Facebook Web dialogs inside a Dialog. Helper methods are provided to construct commonly-used dialogs, or a caller can specify arbitrary parameters to call other dialogs.


Nested Class Summary
static class WebDialog.Builder
          Provides a builder that allows construction of an arbitary Facebook web dialog.
static class WebDialog.FeedDialogBuilder
          Provides a builder that allows construction of the parameters for showing the Feed Dialog (https://developers.facebook.com/docs/reference/dialogs/feed/).
static interface WebDialog.OnCompleteListener
          Interface that implements a listener to be called when the user's interaction with the dialog completes, whether because the dialog finished successfully, or it was cancelled, or an error was encountered.
static class WebDialog.RequestsDialogBuilder
          Provides a builder that allows construction of the parameters for showing the Feed Dialog (https://developers.facebook.com/docs/reference/dialogs/feed/).
 
Nested classes/interfaces inherited from interface android.content.DialogInterface
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
 
Field Summary
static int DEFAULT_THEME
           
 
Fields inherited from interface android.content.DialogInterface
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
 
Constructor Summary
WebDialog(Context context, String url)
          Constructor which can be used to display a dialog with an already-constructed URL.
WebDialog(Context context, String action, Bundle parameters, int theme, WebDialog.OnCompleteListener listener)
          Constructor which will construct the URL of the Web dialog based on the specified parameters.
WebDialog(Context context, String url, int theme)
          Constructor which can be used to display a dialog with an already-constructed URL and a custom theme.
 
Method Summary
 void dismiss()
           
 WebDialog.OnCompleteListener getOnCompleteListener()
          Gets the listener which will be notified when the dialog finishes.
 void onAttachedToWindow()
           
protected  void onCreate(Bundle savedInstanceState)
           
 void onDetachedFromWindow()
           
 void setOnCompleteListener(WebDialog.OnCompleteListener listener)
          Sets the listener which will be notified when the dialog finishes.
 
Methods inherited from class android.app.Dialog
addContentView, cancel, closeOptionsMenu, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_THEME

public static final int DEFAULT_THEME
See Also:
Constant Field Values
Constructor Detail

WebDialog

public WebDialog(Context context,
                 String url)
Constructor which can be used to display a dialog with an already-constructed URL.

Parameters:
context - the context to use to display the dialog
url - the URL of the Web Dialog to display; no validation is done on this URL, but it should be a valid URL pointing to a Facebook Web Dialog

WebDialog

public WebDialog(Context context,
                 String url,
                 int theme)
Constructor which can be used to display a dialog with an already-constructed URL and a custom theme.

Parameters:
context - the context to use to display the dialog
url - the URL of the Web Dialog to display; no validation is done on this URL, but it should be a valid URL pointing to a Facebook Web Dialog
theme - identifier of a theme to pass to the Dialog class

WebDialog

public WebDialog(Context context,
                 String action,
                 Bundle parameters,
                 int theme,
                 WebDialog.OnCompleteListener listener)
Constructor which will construct the URL of the Web dialog based on the specified parameters.

Parameters:
context - the context to use to display the dialog
action - the portion of the dialog URL following "dialog/"
parameters - parameters which will be included as part of the URL
theme - identifier of a theme to pass to the Dialog class
listener - the listener to notify, or null if no notification is desired
Method Detail

setOnCompleteListener

public void setOnCompleteListener(WebDialog.OnCompleteListener listener)
Sets the listener which will be notified when the dialog finishes.

Parameters:
listener - the listener to notify, or null if no notification is desired

getOnCompleteListener

public WebDialog.OnCompleteListener getOnCompleteListener()
Gets the listener which will be notified when the dialog finishes.

Returns:
the listener, or null if none has been specified

dismiss

public void dismiss()
Specified by:
dismiss in interface DialogInterface
Overrides:
dismiss in class Dialog

onDetachedFromWindow

public void onDetachedFromWindow()
Specified by:
onDetachedFromWindow in interface Window.Callback
Overrides:
onDetachedFromWindow in class Dialog

onAttachedToWindow

public void onAttachedToWindow()
Specified by:
onAttachedToWindow in interface Window.Callback
Overrides:
onAttachedToWindow in class Dialog

onCreate

protected void onCreate(Bundle savedInstanceState)
Overrides:
onCreate in class Dialog