Example usage for android.webkit WebView hashCode

List of usage examples for android.webkit WebView hashCode

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:com.pdi.hybridge.HybridgeBroadcaster.java

public static void destroy(WebView client) {
    sClients.remove(client.hashCode());
}

From source file:com.pdi.hybridge.HybridgeBroadcaster.java

public static synchronized HybridgeBroadcaster getInstance(WebView client) {
    final int hash = client.hashCode();
    WeakReference<HybridgeBroadcaster> instance = sClients.get(hash);
    if (instance == null || instance.get() == null) {
        instance = new WeakReference<HybridgeBroadcaster>(new HybridgeBroadcaster());
        sClients.put(hash, instance);//from w w  w  . ja v  a2s.c o m
    }
    return instance.get();
}

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

@SuppressLint("SetJavaScriptEnabled")
private static void callInternalBrowser(AdWebView webView, Uri uri) {
    String urlParam = uri.getQueryParameter("url");

    if ((webView.getContext() == null) || (urlParam == null) || (!urlParam.startsWith("http"))) {
        return;/* w  ww  . j  a  v a  2s.  c  o m*/
    }

    String url = Uri.decode(urlParam);
    Class<?> activity_clz = AdActivity.getActivityClass();

    Intent intent = new Intent(webView.getContext(), activity_clz);
    intent.putExtra(AdActivity.INTENT_KEY_ACTIVITY_TYPE, AdActivity.ACTIVITY_TYPE_BROWSER);

    WebView browserWebView = new WebView(webView.getContext());
    WebviewUtil.setWebViewSettings(browserWebView);
    BrowserAdActivity.BROWSER_QUEUE.add(browserWebView);
    browserWebView.loadUrl(url);

    if (webView.adView.getBrowserStyle() != null) {
        String i = "" + browserWebView.hashCode();
        intent.putExtra("bridgeid", i);
        AdView.BrowserStyle.bridge
                .add(new Pair<String, AdView.BrowserStyle>(i, webView.adView.getBrowserStyle()));
    }

    try {
        webView.getContext().startActivity(intent);
    } catch (ActivityNotFoundException e) {
        Toast.makeText(webView.getContext(), R.string.action_cant_be_completed, Toast.LENGTH_SHORT).show();
        Clog.w(Clog.baseLogTag, Clog.getString(R.string.adactivity_missing, activity_clz.getName()));
        BrowserAdActivity.BROWSER_QUEUE.remove();
    }
}