Example usage for android.webkit WebView getResources

List of usage examples for android.webkit WebView getResources

Introduction

In this page you can find the example usage for android.webkit WebView getResources.

Prototype

public Resources getResources() 

Source Link

Document

Returns the resources associated with this view.

Usage

From source file:com.appnexus.opensdk.MRAIDImplementation.java

String onPreLoadContent(WebView wv, String html) {
    // Check to ensure <html> tags are present
    if (!html.contains("<html>")) {
        html = "<html><head></head><body style='padding:0;margin:0;'>" + html + "</body></html>";
    } else if (!html.contains("<head>")) {
        // The <html> tags are present, but there is no <head> section to
        // inject the mraid js
        html = html.replace("<html>", "<html><head></head>");
    }//from  ww  w .  ja  va2  s . co m

    // Insert mraid script source
    html = html.replace("<head>", "<head><script>" + getMraidDotJS(wv.getResources()) + "</script>");

    return html;
}