How to start new Activity by clicking button on html page loaded in webview?
<p>I want to start an Activity by clicking button on html page which has been loaded in webview. I tried following code to  load webview instance with html file and create an interface so that it can be accessed using javascript from html page.</p>

<pre><code>public void UpdateWebViewClientWithURL(String url)
{ 
WebView.enablePlatformNotifications();
WebView myWebView = (WebView) findViewById(R.id.webview);

WebSettings webSettings = myWebView.getSettings();
webSetings.setJavaScriptEnabled(true);
myWebView.addJavascriptInterface(new CommonLibrary(this.getApplicationContext()),    "Android"); 

myWebView.loadUrl(url);
}
</code></pre>

<p>Javascript in html page looks like this</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function showAndroidToast() {
        Android.launchActivity();
    }
&lt;/script&gt;
</code></pre>

<p>Now in CommonLibrary class file , I have following function define to lunch new Activity</p>

<pre><code>public void launchActivity()
{
Intent myIntent = new Intent(mContext, testactivity.class);
mContext.startActivity(myIntent);
}
</code></pre>

<p>With all these setting i am seeing every time i click the button, the application is crashing. I know there is way but i searched every possible way , can anyone please help me understand as what is wrong here or how can i achieve this with simple example ?
Appreciate your help and time !</p>
