简体   繁体   中英

My responsive site doesn't work in WebView but does in Android browsers

Since I know very little about Java programming I'm probably in over my head but I'll be as specific as I can.

My sites is responsive and works in chrome and the default android browser perfectly. I tried to wrap it in a WebView app while I scratched and clawed my way through learning Java correctly so I could write a decent app.

Elements on the responsive page don't display in the WebView app but do in browsers on my phone. So without further a due, here is the code and the URL:

www.dirtywasted.com user: stackoverflow pass: stackoverflow

package com.dirtywasted.dirtywasted;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;


public class MainActivity extends ActionBarActivity {

private WebView mWebView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mWebView = (WebView) findViewById(R.id.activity_main_webview);
    mWebView.loadUrl("http://www.dirtywasted.com/");
    // Stop local links and redirects from opening in browser instead of WebView
    mWebView.setWebViewClient(new MyAppWebViewClient());
}

}

I hope I've posted enough info....

Thanks in advance for any help.

Oh, and specifically I've noticed the place where ya update your status is disappearing and the button on the right that expands the menu doesn't nothing in the app.... I assume it's due to the same thing. Probably not allowing Java to run in the WebView.

Did you check your AndroidManifest.xml?

Add the INTERNET permission:

<uses-permission android:name="android.permission.INTERNET" /> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM