本文整理汇总了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);
}