I want to create like plugin for applications. When the specific button is clicked the webview should be opened on top of the app(activity). The whole logic for this webview should be in .jar library. It should not open new activity, because then I need to copy new layout(.xml file) in to project but I do not want to do this, because adding this new library (plugin) should be as simple as possible. I also should not change the existing layout.
Is any way to open this webview by just adding some lines of code to program and then control everything from library vithout making changes in layouts (.xml).
Update solution: I solve this by calling new activity from library but this activity does not load .xml layout but webView.
Project activity:
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, LibraryActivity.class));
}
Library activity:
WebView web;
web= new WebView(this);
web.loadUrl("http://www.google.com");
web.setWebViewClient(new WebViewClient());
setContentView(web);