本文整理汇总了Java中cn.eoe.app.utils.CommonUtil类的典型用法代码示例。如果您正苦于以下问题:Java CommonUtil类的具体用法?Java CommonUtil怎么用?Java CommonUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommonUtil类属于cn.eoe.app.utils包,在下文中一共展示了CommonUtil类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPostExecute
import cn.eoe.app.utils.CommonUtil; //导入依赖的package包/类
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if (result != null) {
String linkCss = "<link rel=\"stylesheet\" href=\"file:///android_asset/pygments.css\" type=\"text/css\"/>";
String content = linkCss + result;
try {
content = content.replace(
"img{}",
"img{width:"
+ CommonUtil.px2dip(DetailsActivity.this,
screen_width) + "}");
content = content.replaceAll("<br />", "");
} catch (NullPointerException e) {
e.printStackTrace();
}
loadLayout.setVisibility(View.GONE);
failLayout.setVisibility(View.GONE);
mWebView.setVisibility(View.VISIBLE);
mWebView.setBackgroundResource(R.color.detail_bgColor);
mWebView.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
} else {
loadLayout.setVisibility(View.GONE);
mWebView.setVisibility(View.GONE);
failLayout.setVisibility(View.VISIBLE);
}
}
示例2: onPostExecute
import cn.eoe.app.utils.CommonUtil; //导入依赖的package包/类
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
if (result != null) {
mWebView.setBackgroundResource(R.color.detail_bgColor);
}
String linkCss = "<link rel=\"stylesheet\" href=\"file:///android_asset/pygments.css\" type=\"text/css\"/>";
String content = linkCss + result;
try {
content = content.replace(
"img{}",
"img{width:"
+ CommonUtil.px2dip(DetailsActivity.this,
screen_width) + "}");
content = content.replaceAll("<br />", "");
} catch (NullPointerException e) {
e.printStackTrace();
}
loadLayout.setVisibility(View.GONE);
mWebView.setVisibility(View.VISIBLE);
mWebView.setBackgroundResource(R.color.detail_bgColor);
int a = Integer.valueOf(android.os.Build.VERSION.SDK);
Log.i("info", a + "");
mWebView.loadDataWithBaseURL(null, content, "text/html", "utf-8",
null);
}