public class

AirshipWebView

extends WebView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.AbsoluteLayout
         ↳ android.webkit.WebView
           ↳ com.urbanairship.webkit.AirshipWebView
Known Direct Subclasses

Class Overview

A web view that sets settings appropriate for Airship content.

Summary

[Expand]
Inherited Constants
From class android.webkit.WebView
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AirshipWebView(Context context)
AirshipWebView Constructor
AirshipWebView(Context context, AttributeSet attrs)
AirshipWebView Constructor
AirshipWebView(Context context, AttributeSet attrs, int defStyle)
AirshipWebView Constructor
AirshipWebView(Context context, AttributeSet attrs, int defStyle, int defResStyle)
AirshipWebView Constructor
Public Methods
void loadData(String data, String mimeType, String encoding)
void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl)
void loadUrl(String url)
Loads the given URL.
void loadUrl(String url, Map<StringString> additionalHttpHeaders)
Loads the given URL with the specified additional HTTP headers.
void setWebViewClient(WebViewClient webViewClient)
Protected Methods
String createBasicAuth(String userName, String password)
Creates a basic auth string.
void initializeView()
Initializes the web view with any default settings.
void onPreLoad()
Called right before data or a URL is passed to the web view to be loaded.
void populateCustomJavascriptInterfaces()
Populate any custom javascript interfaces by calling addJavascriptInterface(Object interface, String identifier) for each custom interface.
void setClientAuthRequest(String url, String username, String password)
Set the client authorization request.
[Expand]
Inherited Methods
From class android.webkit.WebView
From class android.widget.AbsoluteLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewGroup.OnHierarchyChangeListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.ViewTreeObserver.OnGlobalFocusChangeListener
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public AirshipWebView (Context context)

AirshipWebView Constructor

Parameters
context A Context object used to access application assets.

public AirshipWebView (Context context, AttributeSet attrs)

AirshipWebView Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.

public AirshipWebView (Context context, AttributeSet attrs, int defStyle)

AirshipWebView Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.
defStyle The default style resource ID.

public AirshipWebView (Context context, AttributeSet attrs, int defStyle, int defResStyle)

AirshipWebView Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.
defStyle The default style resource ID.
defResStyle A resource identifier of a style resource that supplies default values for the view, used only if defStyle is 0 or cannot be found in the theme. Can be 0 to not look for defaults.

Public Methods

public void loadData (String data, String mimeType, String encoding)

public void loadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding, String historyUrl)

public void loadUrl (String url)

Loads the given URL.

Parameters
url The URL of the resource to load.

public void loadUrl (String url, Map<StringString> additionalHttpHeaders)

Loads the given URL with the specified additional HTTP headers.

Parameters
url The URL to load.
additionalHttpHeaders The additional headers to be used in the HTTP request for this URL.

public void setWebViewClient (WebViewClient webViewClient)

Protected Methods

protected String createBasicAuth (String userName, String password)

Creates a basic auth string.

Parameters
userName The user name.
password The password.
Returns
  • The basic auth string.

protected void initializeView ()

Initializes the web view with any default settings.

Called during create.

protected void onPreLoad ()

Called right before data or a URL is passed to the web view to be loaded.

protected void populateCustomJavascriptInterfaces ()

Populate any custom javascript interfaces by calling addJavascriptInterface(Object interface, String identifier) for each custom interface.

Called after initializeView.

protected void setClientAuthRequest (String url, String username, String password)

Set the client authorization request.

Parameters
url The URL string.
username The auth user
password The auth password