public class WebDialog
extends android.app.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.
| Modifier and Type | Class and Description |
|---|---|
static class |
WebDialog.Builder |
static interface |
WebDialog.InitCallback |
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.
|
android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Modifier | Constructor and Description |
|---|---|
protected |
WebDialog(android.content.Context context,
java.lang.String url)
Constructor which can be used to display a dialog with an already-constructed URL.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
dismiss() |
WebDialog.OnCompleteListener |
getOnCompleteListener()
Gets the listener which will be notified when the dialog finishes.
|
static int |
getWebDialogTheme()
Gets the theme used by
WebDialog |
protected android.webkit.WebView |
getWebView() |
protected static void |
initDefaultTheme(android.content.Context context) |
protected boolean |
isListenerCalled() |
protected boolean |
isPageFinished() |
static WebDialog |
newInstance(android.content.Context context,
java.lang.String action,
android.os.Bundle parameters,
int theme,
WebDialog.OnCompleteListener listener) |
void |
onAttachedToWindow() |
protected void |
onCreate(android.os.Bundle savedInstanceState) |
void |
onDetachedFromWindow() |
boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event) |
protected void |
onStart() |
protected void |
onStop() |
void |
onWindowAttributesChanged(android.view.WindowManager.LayoutParams params) |
protected android.os.Bundle |
parseResponseUri(java.lang.String urlString) |
void |
resize() |
protected void |
sendErrorToListener(java.lang.Throwable error) |
protected void |
sendSuccessToListener(android.os.Bundle values) |
protected void |
setExpectedRedirectUrl(java.lang.String expectedRedirectUrl) |
static void |
setInitCallback(WebDialog.InitCallback callback) |
void |
setOnCompleteListener(WebDialog.OnCompleteListener listener)
Sets the listener which will be notified when the dialog finishes.
|
static void |
setWebDialogTheme(int theme)
Sets the theme used by
WebDialog |
addContentView, closeOptionsMenu, create, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, requireViewById, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenuprotected WebDialog(android.content.Context context,
java.lang.String url)
context - the context to use to display the dialogurl - 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 Dialogprotected static void initDefaultTheme(android.content.Context context)
public static WebDialog newInstance(android.content.Context context, java.lang.String action, android.os.Bundle parameters, int theme, WebDialog.OnCompleteListener listener)
public static int getWebDialogTheme()
WebDialogpublic static void setWebDialogTheme(int theme)
WebDialogtheme - A theme to usepublic void setOnCompleteListener(WebDialog.OnCompleteListener listener)
listener - the listener to notify, or null if no notification is desiredpublic WebDialog.OnCompleteListener getOnCompleteListener()
public boolean onKeyDown(int keyCode,
android.view.KeyEvent event)
onKeyDown in interface android.view.KeyEvent.CallbackonKeyDown in class android.app.Dialogpublic void dismiss()
dismiss in interface android.content.DialogInterfacedismiss in class android.app.Dialogprotected void onStart()
onStart in class android.app.Dialogprotected void onStop()
onStop in class android.app.Dialogpublic void onDetachedFromWindow()
onDetachedFromWindow in interface android.view.Window.CallbackonDetachedFromWindow in class android.app.Dialogpublic void onAttachedToWindow()
onAttachedToWindow in interface android.view.Window.CallbackonAttachedToWindow in class android.app.Dialogpublic void onWindowAttributesChanged(android.view.WindowManager.LayoutParams params)
onWindowAttributesChanged in interface android.view.Window.CallbackonWindowAttributesChanged in class android.app.Dialogprotected void onCreate(android.os.Bundle savedInstanceState)
onCreate in class android.app.Dialogprotected void setExpectedRedirectUrl(java.lang.String expectedRedirectUrl)
protected android.os.Bundle parseResponseUri(java.lang.String urlString)
protected boolean isListenerCalled()
protected boolean isPageFinished()
protected android.webkit.WebView getWebView()
public void resize()
protected void sendSuccessToListener(android.os.Bundle values)
protected void sendErrorToListener(java.lang.Throwable error)
public void cancel()
cancel in interface android.content.DialogInterfacecancel in class android.app.Dialogpublic static void setInitCallback(WebDialog.InitCallback callback)