package com.nexstreaming.app.apis;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;


/**
 * VAST Sample Activity.
 */
public class NexVASTWebViewClient extends WebViewClient {
    Context mContext;
    NexVASTWebViewClient(Context context) {
        mContext = context;
    }
    @Override
    public boolean shouldOverrideUrlLoading(WebView view,  WebResourceRequest request) {

        // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
        Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());
        mContext.startActivity(intent);
        return true;
    }
}