I have a webview on my MainActivity .. This loaded with a url set by a onclick button handling. When the webview is loaded with a certain webpage. I want to clone or duplicate (or even move) it to my secondary display/screen.
For the secondary display i have a seperate Presentation class:
private class BrowserPresentation extends Presentation {
BrowserPresentation(Context ctxt, Display display) { super(ctxt, display); }
WebView webView2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
webView2=new WebView(webView.getContext()); //get webView class of mainactivity
webView2.setWebViewClient(new WebViewClient());
webView2.setInitialScale(100);
setContentView(webView2);
}
}
However this is not working, is it even possible? Am I taking the wrong route? Can't find much on internet about secondary screen handling.
Update: I don't want to load same page, need to get current page loaded on MainActivity: Want to login on MainActivity then after the login duplicate/move it to second screen(readonly).