Android应用程序iFrame一个网站

Joh*_*rry 3 iframe android google-play

如何在Android中创建用于在Eclipse中iframes网站的应用程序.它的代码是什么?

提前致谢!

A.Q*_*oga 15

我总是做一个例子,像这样:

首先放入一个xml布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <WebView 
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

然后在Activity类中,在onCreate中使用它:

@Override protected void onCreate(Bundle savedInstanceState) 
{
        super.onCreate(savedInstanceState);
        WebView webview;
        webview = (WebView) findViewById(R.id.webview);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.loadUrl("http://www.google.com");
}
Run Code Online (Sandbox Code Playgroud)