当前位置: 首页>>代码示例>>Java>>正文


Java LogUtils.d方法代码示例

本文整理汇总了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);
                }
            }
        }
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:28,代码来源:BitmapCache.java

示例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;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:ColumnUtils.java

示例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;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:21,代码来源:ColumnUtils.java

示例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;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:13,代码来源:ColumnUtils.java

示例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;
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:16,代码来源:ColumnUtils.java

示例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);
            }
        }
    };
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:32,代码来源:PriorityAsyncTask.java

示例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);
            }
        }
    };
}
 
开发者ID:android-quick-dev,项目名称:AndroidDevFramework,代码行数:31,代码来源:PriorityAsyncTask.java

示例8: debugSql

import com.lidroid.xutils.util.LogUtils; //导入方法依赖的package包/类
private void debugSql(String sql) {
    if (debug) {
        LogUtils.d(sql);
    }
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:6,代码来源:DbUtils.java


注:本文中的com.lidroid.xutils.util.LogUtils.d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。