本文整理匯總了Java中com.socks.jiandan.net.Request4FreshNewsDetail類的典型用法代碼示例。如果您正苦於以下問題:Java Request4FreshNewsDetail類的具體用法?Java Request4FreshNewsDetail怎麽用?Java Request4FreshNewsDetail使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Request4FreshNewsDetail類屬於com.socks.jiandan.net包,在下文中一共展示了Request4FreshNewsDetail類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onActivityCreated
import com.socks.jiandan.net.Request4FreshNewsDetail; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
freshNews = (FreshNews) getArguments().getSerializable(DATA_FRESH_NEWS);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (newProgress > 80) {
loading.stop();
}
}
});
executeRequest(new Request4FreshNewsDetail(FreshNews.getUrlFreshNewsDetail(freshNews.getId()),
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
webView.loadDataWithBaseURL("", getHtml(freshNews, response), "text/html", "utf-8", "");
}
}, new
Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}));
loading.start();
loading.postDelayed(new Runnable() {
@Override
public void run() {
if (loading.isShown()) {
loading.stop();
}
}
}, 10 * 1000);
}