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