如何在 android 的后者边界内打开另一个应用程序内的应用程序?即,类似于 iframe 在 HTML 中的作用。
最佳答案
你基本上不能。它违反了Android的规则。您最多只能打开一个网页作为应用程序的一部分。这是使用 webView 完成的。您可以通过在Webview的xml文件中设置webview的bounds来控制屏幕的边界。
public class WebViewFragment extends Fragment {
public static final String ARG_SECTION_NUMBER = "section_number";
public WebViewFragment() {
}
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View mainView = inflater.inflate(R.layout.fragment_facebook,
container, false);
WebView webView = (WebView) mainView.findViewById(R.id.webView1);
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setSupportZoom(false);
webView.getSettings()
.setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDomStorageEnabled(true);
webView.loadUrl(""); //URL needs to be entered in this line
return mainView;
}
}
希望这有帮助:)
关于java - 如何在 android 的后者边界内的另一个应用程序内打开一个应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33734825/