本文整理汇总了Java中com.github.snowdream.android.util.Log.e方法的典型用法代码示例。如果您正苦于以下问题:Java Log.e方法的具体用法?Java Log.e怎么用?Java Log.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.snowdream.android.util.Log
的用法示例。
在下文中一共展示了Log.e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* update table rows by table columnName(update if column's value is same)
* <br>
* 根据给定的字段名,批量更新数据库
*
* @param list the list to be updated
* @param columnName the key column
* @return boolean
*/
public boolean update(List<?> list, String columnName) {
lock.writeLock().lock();
if (list == null || list.size() == 0) {
return false;
}
Object temp = list.get(0);
filter(temp.getClass());
String tableName = AnnotationUtil.getClassName(temp.getClass());
Cursor cursor = null;
try {
cursor = database.query(tableName, null, null, null, null, null, null, "1");
for (int i = 0, l = list.size(); i < l; i++) {
Object model = list.get(i);
update(tableName, model, columnName, cursor);
}
} catch (Exception e) {
Log.e("Exception", e);
} finally {
closeCursor(cursor);
lock.writeLock().unlock();
}
return true;
}
示例2: uncaughtException
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* 当UncaughtException发生时会转入该函数来处理
* @param thread thread
* @param ex exception
*/
@Override
public void uncaughtException(Thread thread, Throwable ex) {
if (!handleException(ex) && mDefaultHandler != null) {
//如果用户没有处理则让系统默认的异常处理器来处理
mDefaultHandler.uncaughtException(thread, ex);
} else {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
Log.e("error : ", e);
}
//退出程序
AppManager.getAppManager().AppExit(mContext);
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}
}
示例3: saveModel
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* Save container to model
*
* @param container container
* @param model model
*/
public static void saveModel(Object container, Object model) {
Field[] fields = container.getClass().getDeclaredFields();
if (fields == null) return;
if (model == null) return;
for (Field field : fields) {
InjectBinding binding = field.getAnnotation(InjectBinding.class);
if (binding != null) {
field.setAccessible(true);
try {
String fieldName = binding.value();
saveValue(field, fieldName, model, container);
} catch (Exception e) {
Log.e(e.getMessage());
}
}
}
}
示例4: setKeyValue
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* set keyvalue of an saved obj
*
* @param obj
* @param key
* @return
*/
public static void setKeyValue(Object obj, Object key) {
Field[] fields = obj.getClass().getDeclaredFields();
if (fields != null) {
Id id = null;
Field idField = null;
for (Field field : fields) { //获取ID注解
id = field.getAnnotation(Id.class);
if (id != null) {
idField = field;
break;
}
}
if (id != null) { //有ID注解
// primaryKey = idField.getName();
try {
idField.setAccessible(true);
idField.set(obj, key);
} catch (IllegalAccessException e) {
Log.e("set key value failed:" + e.getMessage());
}
} else {
throw new RuntimeException("@Id annotation is not found, Please make sure the @Id annotation is added in Model!");
}
}
}
示例5: copyFile
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* 拷贝文件
*
* @param srcPath srcPath of file
* @param desPaht desPathe of file
* @return boolean if copy success
*/
public static boolean copyFile(String srcPath, String desPaht) {
try {
File originFile = new File(srcPath);
File destFile = new File(desPaht);
String tempsrcName = originFile.getName();
String tempsrcPath = originFile.getCanonicalPath().replace(tempsrcName, "");
String tempdesName = destFile.getName();
String tempdesPath = destFile.getPath().replace(tempdesName, "");
return copyFile(tempsrcPath, tempsrcName, tempdesPath, tempdesName);
} catch (Exception e) {
Log.e("copyFileError", e);
}
return false;
}
示例6: query
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* query first row by the given condition
* <br>
* 根据条件查询一条记录
*
* @param c Type
* @param selection where string
* @param condition where list
* @return Object 没有查找到返回null
*/
public <T> T query(Class<T> c, String selection, String[] condition) {
lock.readLock().lock();
T result = null;
try {
filter(c);
List<T> items = query(c, selection, condition, null, "1");
if (items != null && items.size() > 0) {
result = items.get(0);
}
} catch (Exception e) {
Log.e("Exception", e);
} finally {
lock.readLock().unlock();
}
return result;
}
示例7: dismissDialog
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* 关闭对话框
*
* @param joinPoint
* @throws IllegalAccessException
*/
@After("execution(@zilla.libcore.ui.SupportMethodLoading * *(..))")
public void dismissDialog(ProceedingJoinPoint joinPoint) {
try {
Object container = joinPoint.getTarget();
Field[] fields = container.getClass().getFields();
for (Field field : fields) {
if (field.getAnnotation(LifeCircleInject.class) != null) {
if (IDialog.class.isAssignableFrom(field.getType())) {
IDialog iDialog = (IDialog) field.get(container);
iDialog.dismiss();
return;
}
}
}
} catch (Exception e) {
Log.e(e.getMessage());
}
}
示例8: onUpgrade
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* This is called when your application is upgraded and it has a higher
* version number. This allows you to adjust the various data to match the
* new version number.
*/
@Override
public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion,
int newVersion) {
try {
Log.i("onUpgrade");
TableUtils.dropTable(connectionSource, Album.class, true);
TableUtils.dropTable(connectionSource, Albums.class, true);
TableUtils.dropTable(connectionSource, Image.class, true);
// after we drop the old databases, we create the new ones
onCreate(db, connectionSource);
} catch (SQLException e) {
Log.e("Can't drop databases", e);
throw new RuntimeException(e);
}
}
示例9: AcceptThread
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
public AcceptThread() {
BluetoothServerSocket tmp = null;
// Create a new listening server socket
try {
tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE, MY_UUID_SECURE);
} catch (IOException e) {
Log.e(TAG, "listenUsingRfcommWithServiceRecord failed", e);
}
mmServerSocket = tmp;
}
示例10: saveCatchInfo2File
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* 保存错误信息到文件中
*
* @param ex Throwable
* @return 返回文件名称, 便于将文件传送到服务器
*/
private String saveCatchInfo2File(Throwable ex) {
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : infos.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value + "\n");
}
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
ex.printStackTrace(printWriter);
Throwable cause = ex.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
printWriter.close();
String result = writer.toString();
sb.append(result);
try {
long timestamp = System.currentTimeMillis();
String time = DateTime.now().toString("yyyy-MM-dd");
String fileName = "crash-" + time + "-" + timestamp + ".log";
File file = FileHelper.createFile(FileHelper.PATH_DOWNLOAD+fileName);
FileOutputStream fos = new FileOutputStream(file);
fos.write(sb.toString().getBytes());
//发送给开发人员
sendCrashLog2PM(file.getAbsolutePath());
Util.closeStream(fos);
// }
return fileName;
} catch (Exception e) {
Log.e( "an error occured while writing file...", e);
}
return null;
}
示例11: cancel
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
public void cancel() {
try {
mmSocket.close();
} catch (IOException e) {
Log.e(TAG, "close() of connect socket failed", e);
}
}
示例12: show
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* show dialog
*/
@Override
public void show() {
try {
if (dialogEntity != null) {
dialogEntity.show();
}
} catch (Exception e) {
Log.e(e.getMessage());
}
}
示例13: updateAll
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* delete all and add all from a list
* <br>
* 删除表中所有数据, 并重新插入数据
*
* @param c Type
* @param list the list to be saved
* @return boolean
*/
public boolean updateAll(Class<?> c, List<?> list) {
lock.writeLock().lock();
try {
deleteAll(c);
saveList(list);
} catch (Exception e) {
Log.e(e.getMessage());
return false;
} finally {
lock.writeLock().unlock();
}
return true;
}
示例14: PropertiesManager
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
private PropertiesManager(Context context) {
InputStream is = null;
try {
is = Zilla.APP.getAssets().open("config/system.properties");
properties = new Properties();
properties.load(is);
} catch (IOException e) {
Log.e(e.getMessage());
} finally {
Util.closeStream(is);
}
}
示例15: saveList
import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
* insert multi-row.
* <br>
* 插入多条记录
*
* @param list the list to be saved
* @return boolean
*/
public boolean saveList(List<?> list) {
lock.writeLock().lock();
if (list == null || list.size() == 0) {
return false;
}
ContentValues values = null;
Cursor cursor = null;
try {
Object temp = list.get(0);
filter(temp.getClass());
String tableName = AnnotationUtil.getClassName(temp.getClass());
cursor = database.query(tableName, null, null, null, null, null, null, "1");
database.beginTransaction();
for (int i = 0, l = list.size(); i < l; i++) {
Object model = list.get(i);
// values = model2ContentValues(model, cursor);
// this.database.insert(tableName, null, values);
save(model);
// model._id = String.valueOf(getLast_insert_rowid());
}
database.setTransactionSuccessful();// 必须执行该方法,否则事务会回滚
database.endTransaction();
} catch (Exception e) {
Log.e(e.getMessage());
} finally {
closeCursor(cursor);
lock.writeLock().unlock();
}
return true;
}