Issue
I'm trying to load maps.google.com when user click a button with this url
http://maps.google.com/maps?saddr=40.702297,-73.796015&daddr=40.73682,-73.989937&mrsp=0,1
It works as I expected, but when I click It load only partial of screen(not cover all my screen).
NOTE: I tried to load the same url in browser of emulator, everything is working fine.
Here is setting for the webview that I used to load a web:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.webview_layout);
this.webview = (WebView)findViewById(R.id.myWebview);
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
//....follow by normal setup of webview.setWebViewClient
}
Solution
I found a solution for this problem. In my webview I used a line of code in order to load Twitter website (without this line it will only load a white screen)
webSettings.setUserAgentString("Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3");
Answered By - JHHoang
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.