本文整理汇总了Java中cn.eoe.app.db.DBHelper.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java DBHelper.getInstance方法的具体用法?Java DBHelper.getInstance怎么用?Java DBHelper.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.eoe.app.db.DBHelper
的用法示例。
在下文中一共展示了DBHelper.getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setThumbnailView
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
/**
* 入口
*
* @param imageUrl
* @param iv_item_image
* @param context
* @param callback
* @param b
*/
public static void setThumbnailView(String imageUrl,
ImageView iv_item_image, Context context, ImageCallback callback,
boolean b) {
DBHelper dbHelper = DBHelper.getInstance(context);
String md5 = ImageUtil.md5(imageUrl);
// 缓存目录
if (!CommonUtil.sdCardIsAvailable())/* true 为可用 */{
String cachePath = context.getCacheDir().getAbsolutePath() + "/" + md5; // data里的缓存
setThumbnailImage(iv_item_image, imageUrl, cachePath, dbHelper,
callback, b);
iv_item_image.setTag(cachePath);
} else {
String imagePath = getExternalCacheDir(context) + File.separator + md5; // sd卡
setThumbnailImage(iv_item_image, imageUrl, imagePath, dbHelper,
callback, b);
iv_item_image.setTag(imagePath);
}
}
示例2: setThumbnailView
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
/**
* 入口
*
* @param imageUrl
* @param iv_item_image
* @param context
* @param callback
* @param b
*/
public static void setThumbnailView(String imageUrl,
ImageView iv_item_image, Context context, ImageCallback callback,
boolean b) {
DBHelper dbHelper = DBHelper.getInstance(context);
String md5 = ImageUtil.md5(imageUrl);
String cachePath = context.getCacheDir().getAbsolutePath() + "/" + md5; // data里的缓存
String imagePath = getExternalCacheDir(context) + File.separator + md5; // sd卡
// 缓存目录
if (!CommonUtil.sdCardIsAvailable())/* true 为可用 */{
setThumbnailImage(iv_item_image, imageUrl, cachePath, dbHelper,
callback, b);
iv_item_image.setTag(cachePath);
} else {
setThumbnailImage(iv_item_image, imageUrl, imagePath, dbHelper,
callback, b);
iv_item_image.setTag(imagePath);
}
}
示例3: getRequestContent
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
public static String getRequestContent(Context context, String RequestUrl,
String source_type, String content_type, boolean UseCache) {
DBHelper dbHelper = DBHelper.getInstance(context);
String md5 = MD5.encode(RequestUrl);
// 缓存目录
if (!CommonUtil.sdCardIsAvailable())/* true 为可用 */{
String cachePath = context.getCacheDir().getAbsolutePath() + "/" + md5; // data里的缓存
return getCacheRequest(context, RequestUrl, cachePath, source_type,
content_type, dbHelper, UseCache);
} else {
String imagePath = getExternalCacheDir(context) + File.separator + md5; // sd卡
return getCacheRequest(context, RequestUrl, imagePath, source_type,
content_type, dbHelper, UseCache);
}
}
示例4: onDestroy
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
try {
DBHelper db = DBHelper.getInstance(this);
db.closeDb();
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: getRequestContent
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
public static String getRequestContent(Context context, String RequestUrl,
String source_type, String content_type, boolean UseCache) {
DBHelper dbHelper = DBHelper.getInstance(context);
String md5 = MD5.encode(RequestUrl);
String cachePath = context.getCacheDir().getAbsolutePath() + "/" + md5; // data里的缓存
String imagePath = getExternalCacheDir(context) + File.separator + md5; // sd卡
// 缓存目录
if (!CommonUtil.sdCardIsAvailable())/* true 为可用 */{
return getCacheRequest(context, RequestUrl, cachePath, source_type,
content_type, dbHelper, UseCache);
} else {
return getCacheRequest(context, RequestUrl, imagePath, source_type,
content_type, dbHelper, UseCache);
}
}
示例6: onDestroy
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
try {
DBHelper db = DBHelper.getInstance(this);
db.closeDb();
} catch (Exception e) {
e.printStackTrace();
}
}
示例7: DetailDB
import cn.eoe.app.db.DBHelper; //导入方法依赖的package包/类
public DetailDB(Context context) {
dbHelper = DBHelper.getInstance(context);
}