웹보기로 특정 Google지도 URL을 열 수 없습니다.
그리고 이것은 내 코드입니다
WebView wv = (WebView) view.findViewById(R.id.webPlace);
WebSettings ws = wv.getSettings();
ws.setPluginState(PluginState.ON);
ws.getSettings().setPluginState(WebSettings.PluginState.ON);
ws.setJavaScriptEnabled(true);
ws.setAllowFileAccess(true);
wv.loadUrl("https://www.google.com.sa/maps/place/Al+Com/@24.6930318,46.7746621,16z/data=!4m2!3m1!1s0x0000000000000000:0x154b423825155cce");
하지만이 코드 시스템을 실행하려고 할 때마다이 URL을 안드로이드 웹 브라우저의 새로운 활동에서 실행하도록 강요하지만, 같은 응용 프로그램 활동에서 열어야합니다.
// oncreate
String url = "https://www.google.com.sa/maps/place/Al+Com/@24.6930318,46.7746621,16z/data=!4m2!3m1!1s0x0000000000000000:0x154b423825155cce";
new LoadSocialNetworkUrlTask().execute(url);
// asynctask
public class LoadSocialNetworkUrlTask extends
AsyncTask<String, String, Void> {
protected void onPreExecute() {
dialog = new ProgressDialog(SocialNetworkActivity.this);
dialog.setMessage("Loading,Please wait...");
dialog.setIndeterminate(true);
dialog.setCancelable(true);
dialog.show();
}
protected void onProgressUpdate(final String... url) {
try {
((WebView) webView).getSettings().setJavaScriptEnabled(true);
((WebView) webView).setBackgroundColor(Color.TRANSPARENT);
((WebView) webView).setWebViewClient(new WebViewClient() {
@Override
public void onReceivedSslError(WebView view,
SslErrorHandler handler, SslError error) {
handler.proceed(); // Ignore SSL certificate errors
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO hide your progress image
super.onPageFinished(view, url);
dialog.dismiss();
}
});
((WebView) webView).loadUrl(url[0]);
} catch (Exception e) {
e.printStackTrace();
dialog.dismiss();
}
}
@Override
protected Void doInBackground(String... url) {
try {
publishProgress(url);
} catch (Exception e) {
e.printStackTrace();
dialog.dismiss();
}
return null;
}
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다