문제

can anybody tell how to run the local webapplication using android webview

I want to run my own webpages in android using web view

Thanks

도움이 되었습니까?

해결책

I'm guessing you want something like this:

private WebView mWebView;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.yourLayoutWithAWebView);

    mWebView = (WebView)findViewById(R.id.yourWebViewIdFromTheLayout);
    mWebView.getSettings().setJavaScriptEnabled(true); // Enable JavaScript

    mWebView.loadData(yourHtmlData, "text/html", "utf-8");
}

Hopefully, that at least points you in the right direction.

Also, I'd recommend reading the documentation on the WebView, it's pretty thorough.

다른 팁

Just run your application on the emulator, as you normally do (and be sure to have your computer connected to internet).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top