i have write the simple code for Web View and i open the YouTube URL inside the web view. when i open my app YouTube home page is open and when i select any video from YouTube home page i want to save that current URL from web view to any string. whenever i change video i want to save the video URL to string and want it the URL to override to string.
here is my code:
webView.setWebViewClient(new OurViewClient());// class which i have mention below
try {
webView.loadUrl("http://www.youtube.com");
}catch (Exception e){
e.printStackTrace();
}
}
OurViewClient class code:
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
i want to save URL which is passed above when the video is selected from YouTube.When video is changed URL link is also changed in String
can anybody help me with this