com.sponsorpay.sdk.android.publisher
Class InterstitialActivity

java.lang.Object
  extended by Activity
      extended by com.sponsorpay.sdk.android.publisher.InterstitialActivity

public class InterstitialActivity
extends Activity

Shows the SponsorPay mobile interstitial embedded in a WebView.

Will retrieve the interstitial's initial html content from the EXTRA_INITIAL_CONTENT_KEY encoded into the calling intent, and will load dependent content referenced with relative links using the base URL encoded as EXTRA_RESOURCES_BASE_URL_KEY into the calling intent.

The boolean value encoded as EXTRA_SHOULD_STAY_OPEN_KEY into the calling intent will determine the activity's behavior when the user is redirected outside the application. The default behavior is to close the interstitial.


Field Summary
static java.lang.String EXTRA_INITIAL_CONTENT_KEY
           
static java.lang.String EXTRA_RESOURCES_BASE_URL_KEY
           
static java.lang.String EXTRA_SHOULD_STAY_OPEN_KEY
           
private static java.lang.String LOG_TAG
           
private  boolean mShouldStayOpen
           
private  WebView mWebView
           
static int RESULT_CODE_NO_STATUS_CODE
          The result code that is returned when the Offer Wall's parsed exit scheme does not contain a status code.
 
Constructor Summary
InterstitialActivity()
           
 
Method Summary
protected  void onCreate(Bundle savedInstanceState)
           
private  java.lang.String parseURLForProvidedURL(java.lang.String url)
          Extract the provided URL from the exit scheme
private  int parseURLForStatusCodeViaUri(java.lang.String url)
          Extract the status code from the scheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_TAG

private static final java.lang.String LOG_TAG
See Also:
Constant Field Values

EXTRA_SHOULD_STAY_OPEN_KEY

public static final java.lang.String EXTRA_SHOULD_STAY_OPEN_KEY
See Also:
Constant Field Values

EXTRA_INITIAL_CONTENT_KEY

public static final java.lang.String EXTRA_INITIAL_CONTENT_KEY
See Also:
Constant Field Values

EXTRA_RESOURCES_BASE_URL_KEY

public static final java.lang.String EXTRA_RESOURCES_BASE_URL_KEY
See Also:
Constant Field Values

RESULT_CODE_NO_STATUS_CODE

public static final int RESULT_CODE_NO_STATUS_CODE
The result code that is returned when the Offer Wall's parsed exit scheme does not contain a status code.

See Also:
Constant Field Values

mWebView

private WebView mWebView

mShouldStayOpen

private boolean mShouldStayOpen
Constructor Detail

InterstitialActivity

public InterstitialActivity()
Method Detail

onCreate

protected void onCreate(Bundle savedInstanceState)

parseURLForProvidedURL

private java.lang.String parseURLForProvidedURL(java.lang.String url)
Extract the provided URL from the exit scheme

Parameters:
url - the exit scheme url to parse
Returns:
the extracted, provided & decoded URL

parseURLForStatusCodeViaUri

private int parseURLForStatusCodeViaUri(java.lang.String url)
Extract the status code from the scheme

Parameters:
url - the url to parsed for the status code
Returns:
the status code