我想要在我的web視圖中使用loadURL()方法打開HTML頁面..主頁現在只打開,其他鏈接上點擊按鈕不工作..而當我打開我的瀏覽器其工作細所以請給我建議什麼策略,我應該follow..is有可能在Android的標籤,因爲它是在ipad ..my代碼下面請參閱打開..在web視圖中的Android平板電腦中打開HTML內容
package OpenHtml.pkg;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class OpenHtml extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView webview = new WebView(this);
setContentView(webview);
try {
InputStream fin = getAssets().open("index.html");
byte[] buffer = new byte[fin.available()];
fin.read(buffer);
fin.close();
webview.loadUrl("@@@@@@");
} catch (IOException e) {
e.printStackTrace();
}
}
}
檢查它需要互聯網連接或不? – 2012-03-28 06:39:33