本文整理汇总了Java中com.lidroid.xutils.util.LogUtils.d方法的典型用法代码示例。如果您正苦于以下问题:Java LogUtils.d方法的具体用法?Java LogUtils.d怎么用?Java LogUtils.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lidroid.xutils.util.LogUtils
的用法示例。
在下文中一共展示了LogUtils.d方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDiskCache
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
/**
* Initializes the disk cache. Note that this includes disk access so this should not be
* executed on the main/UI thread. By default an ImageCache does not initialize the disk
* cache when it is created, instead you should call initDiskCache() to initialize it on a
* background thread.
*/
public void initDiskCache() {
// Set up disk cache
synchronized (mDiskCacheLock) {
if (globalConfig.isDiskCacheEnabled() && (mDiskLruCache == null || mDiskLruCache.isClosed())) {
File diskCacheDir = new File(globalConfig.getDiskCachePath());
if (diskCacheDir.exists() || diskCacheDir.mkdirs()) {
long availableSpace = OtherUtils.getAvailableSpace(diskCacheDir);
long diskCacheSize = globalConfig.getDiskCacheSize();
diskCacheSize = availableSpace > diskCacheSize ? diskCacheSize : availableSpace;
try {
mDiskLruCache = LruDiskCache.open(diskCacheDir, 1, 1, diskCacheSize);
mDiskLruCache.setFileNameGenerator(globalConfig.getFileNameGenerator());
LogUtils.d("create disk cache success");
} catch (Throwable e) {
mDiskLruCache = null;
LogUtils.e("create disk cache error", e);
}
}
}
}
}
示例2: getColumnGetMethod
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
public static Method getColumnGetMethod(Class<?> entityType, Field field) {
String fieldName = field.getName();
Method getMethod = null;
if (field.getType() == boolean.class) {
getMethod = getBooleanColumnGetMethod(entityType, fieldName);
}
if (getMethod == null) {
String methodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
try {
getMethod = entityType.getDeclaredMethod(methodName);
} catch (NoSuchMethodException e) {
LogUtils.d(methodName + " not exist");
}
}
if (getMethod == null && !Object.class.equals(entityType.getSuperclass())) {
return getColumnGetMethod(entityType.getSuperclass(), field);
}
return getMethod;
}
示例3: getColumnSetMethod
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
public static Method getColumnSetMethod(Class<?> entityType, Field field) {
String fieldName = field.getName();
Method setMethod = null;
if (field.getType() == boolean.class) {
setMethod = getBooleanColumnSetMethod(entityType, field);
}
if (setMethod == null) {
String methodName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
try {
setMethod = entityType.getDeclaredMethod(methodName, field.getType());
} catch (NoSuchMethodException e) {
LogUtils.d(methodName + " not exist");
}
}
if (setMethod == null && !Object.class.equals(entityType.getSuperclass())) {
return getColumnSetMethod(entityType.getSuperclass(), field);
}
return setMethod;
}
示例4: getBooleanColumnGetMethod
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
private static Method getBooleanColumnGetMethod(Class<?> entityType, final String fieldName) {
String methodName = "is" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
if (isStartWithIs(fieldName)) {
methodName = fieldName;
}
try {
return entityType.getDeclaredMethod(methodName);
} catch (NoSuchMethodException e) {
LogUtils.d(methodName + " not exist");
}
return null;
}
示例5: getBooleanColumnSetMethod
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
private static Method getBooleanColumnSetMethod(Class<?> entityType, Field field) {
String fieldName = field.getName();
String methodName = null;
if (isStartWithIs(field.getName())) {
methodName = "set" + fieldName.substring(2, 3).toUpperCase() + fieldName.substring(3);
} else {
methodName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
}
try {
return entityType.getDeclaredMethod(methodName, field.getType());
} catch (NoSuchMethodException e) {
LogUtils.d(methodName + " not exist");
}
return null;
}
示例6: PriorityAsyncTask
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
/**
* Creates a new asynchronous task. This constructor must be invoked on the UI thread.
*/
public PriorityAsyncTask() {
//这一块为什么不直接使用Runnable, 我的见解是这种使用能获取返回值
mWorker = new WorkerRunnable<Params, Result>() {
public Result call() throws Exception { //在子线程中运行
mTaskInvoked.set(true);
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
//noinspection unchecked
return postResult(doInBackground(mParams));
}
};
mFuture = new FutureTask<Result>(mWorker) { //
@Override
protected void done() {
try {
postResultIfNotInvoked(get());
} catch (InterruptedException e) {
LogUtils.d(e.getMessage());
} catch (ExecutionException e) {
throw new RuntimeException("An error occured while executing doInBackground()",
e.getCause());
} catch (CancellationException e) {
postResultIfNotInvoked(null);
}
}
};
}
示例7: PriorityAsyncTask
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
/**
* Creates a new asynchronous task. This constructor must be invoked on the UI thread.
*/
public PriorityAsyncTask() {
mWorker = new WorkerRunnable<Params, Result>() {
public Result call() throws Exception {
mTaskInvoked.set(true);
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
//noinspection unchecked
return postResult(doInBackground(mParams));
}
};
mFuture = new FutureTask<Result>(mWorker) {
@Override
protected void done() {
try {
postResultIfNotInvoked(get());
} catch (InterruptedException e) {
LogUtils.d(e.getMessage());
} catch (ExecutionException e) {
throw new RuntimeException("An error occured while executing doInBackground()",
e.getCause());
} catch (CancellationException e) {
postResultIfNotInvoked(null);
}
}
};
}
示例8: debugSql
import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
private void debugSql(String sql) {
if (debug) {
LogUtils.d(sql);
}
}