如果在网站的webview期间任何时候没有连接,我怎么能显示错误信息.还有什么办法可以隐藏网页错误,如501,404等.提前感谢,我是Android应用程序的新手,所以请详细说明.
package com.website;
import android.app.Activity;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.view.KeyEvent;
import android.view.Window;
import android.content.Context;
import android.net.NetworkInfo;
public class HelloWebView extends Activity {
WebView webview;
/** Called when the activity is first created. */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
webview.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
WebView.enablePlatformNotifications();
webview.getSettings().setJavaScriptEnabled(true);
webview.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
webview.loadUrl("http://www.google.com/");
webview.setWebViewClient(new HelloWebViewClient()); …Run Code Online (Sandbox Code Playgroud) 由于苹果地图adk在街道细节上并不详细,谷歌提供了新的sdk,我试图将其作为当前ios 6的解决方案,我面临的问题是它正在抛出错误无论你在设置中放置了什么样的架构,以下是错误,虽然在sdkmapdemo运行时没有问题:(
Undefined symbols for architecture armv7:
"___gxx_personality_sj0", referenced from:
+[GMSServices provideAPIKey:] in GoogleMaps(GMSServices.o)
+[GMSServices openSourceLicenseInfo] in GoogleMaps(GMSServices.o)
+[GMSServices services] in GoogleMaps(GMSServices.o)
_GMS_NSClassFromString in GoogleMaps(GMSRenames.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud) 我在获取"可排序"中拖动项目的ID时遇到问题,请你帮我解决一下.
<script>
$(document).ready(function(){
$("#div1,#div2,#div3").sortable({
revert: true,
accept: '.draggable',
connectWith: [".sortable_div"],
receive: function(e, ui) {
var item_id = $(this).attr("id");
var drag_id = $(ui.item).attr('id')
alert('alert:'+item_id+' of '+drag_id);
}
}).disableSelection();
});
</script>
<div id="div1" class="sortable_div">
<span id="span1" class="draggable"></span>
</div>
<div id="div2" class="sortable_div">
<span id="span2" class="draggable"></span>
</div>
<div id="div3" class="sortable_div">
<span id="span3" class="draggable"></span>
</div>
Run Code Online (Sandbox Code Playgroud)