I want to show the URl of a video in a TOAST, each time the user click on a video. I get this toast shown only once when I Launch an app first time. Here is my Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mywebview=(WebView)findViewById(R.id.webView);
mywebview.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
Toast.makeText(MainActivity.this,url, Toast.LENGTH_SHORT).show();
return true;
}
});
mywebview.getSettings().setJavaScriptEnabled(true);
mywebview.loadUrl("http://www.youtube.com");
}