当ScrollView遭遇ListView & Webview progress bar

1,用户明细界面,如何从头开始加载。当ScrollView遭遇ListView[OK]
scrollView.post(new Runnable() {
public void run() {
scrollView.fullScroll(ScrollView.FOCUS_UP);
}
});

2,webview progress bar [OK]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.web);

Bundle extras = getIntent().getExtras();
strUrl = extras.getString("strUrl");
//        strUrl = "www.baidu.com";

findViews();
setListener();
goToURL();
}

public void goToURL() {
try {
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new MyWebViewClient());

if (strUrl.startsWith("http://")) {
webview.loadUrl(strUrl);
} else {
webview.loadUrl("http://" + strUrl);
}
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}

public class MyWebViewClient extends WebViewClient {
public void onPageFinished(WebView view, String url) {
setProgressBarIndeterminateVisibility(false);
}

public void onPageStarted(WebView view, String url, Bitmap favicon) {
setProgressBarIndeterminateVisibility(true);
}

// 在WebView中显示页面,而不是默认浏览器中显示页面
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}

你可能感兴趣的:(Android,listview,string,exception,url,浏览器,class)