本文整理汇总了Java中com.activeandroid.util.Log.e方法的典型用法代码示例。如果您正苦于以下问题:Java Log.e方法的具体用法?Java Log.e怎么用?Java Log.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.activeandroid.util.Log
的用法示例。
在下文中一共展示了Log.e方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadModelList
import com.activeandroid.util.Log; //导入方法依赖的package包/类
private List<Class<? extends Model>> loadModelList(String[] models) {
final List<Class<? extends Model>> modelClasses = new ArrayList<Class<? extends Model>>();
final ClassLoader classLoader = mContext.getClass().getClassLoader();
for (String model : models) {
try {
Class modelClass = Class.forName(model.trim(), false, classLoader);
if (ReflectionUtils.isModel(modelClass)) {
modelClasses.add(modelClass);
}
}
catch (ClassNotFoundException e) {
Log.e("Couldn't create class.", e);
}
}
return modelClasses;
}
示例2: loadSerializerList
import com.activeandroid.util.Log; //导入方法依赖的package包/类
private List<Class<? extends TypeSerializer>> loadSerializerList(String[] serializers) {
final List<Class<? extends TypeSerializer>> typeSerializers = new ArrayList<Class<? extends TypeSerializer>>();
final ClassLoader classLoader = mContext.getClass().getClassLoader();
for (String serializer : serializers) {
try {
Class serializerClass = Class.forName(serializer.trim(), false, classLoader);
if (ReflectionUtils.isTypeSerializer(serializerClass)) {
typeSerializers.add(serializerClass);
}
}
catch (ClassNotFoundException e) {
Log.e("Couldn't create class.", e);
}
}
return typeSerializers;
}
示例3: copyAttachedDatabase
import com.activeandroid.util.Log; //导入方法依赖的package包/类
public void copyAttachedDatabase(Context context, String databaseName) {
final File dbPath = context.getDatabasePath(databaseName);
// If the database already exists, return
if (dbPath.exists()) {
return;
}
// Make sure we have a path to the file
dbPath.getParentFile().mkdirs();
// Try to copy database file
try {
final InputStream inputStream = context.getAssets().open(databaseName);
final OutputStream output = new FileOutputStream(dbPath);
byte[] buffer = new byte[8192];
int length;
while ((length = inputStream.read(buffer, 0, 8192)) > 0) {
output.write(buffer, 0, length);
}
output.flush();
output.close();
inputStream.close();
}
catch (IOException e) {
Log.e("Failed to open file", e);
}
}
示例4: onReceive
import com.activeandroid.util.Log; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
final LocationInfo locationInfo = (LocationInfo) intent.getSerializableExtra(LocationLibraryConstants.LOCATION_BROADCAST_EXTRA_LOCATIONINFO);
ParseUser.getCurrentUser().put(Enums.ParseKey.USER_LOCATION,
new ParseGeoPoint(locationInfo.lastLat, locationInfo.lastLong));
Log.d("Location my", locationInfo.lastLat + " " + locationInfo.lastLong);
ParseUser.getCurrentUser().saveInBackground();
}
catch (Exception e){
Log.e("location error:", e.getMessage());
}
if(MainActivity.gi() != null)
MainActivity.gi().onLocationUpdate();
}
示例5: ModelInfo
import com.activeandroid.util.Log; //导入方法依赖的package包/类
public ModelInfo(Configuration configuration) {
if (!loadModelFromMetaData(configuration)) {
try {
scanForModel(configuration.getContext());
}
catch (IOException e) {
Log.e("Couldn't open source path.", e);
}
}
Log.i("ModelInfo loaded.");
}
示例6: closeQuietly
import com.activeandroid.util.Log; //导入方法依赖的package包/类
/**
* <p>
* Unconditionally close a {@link Closeable}.
* </p>
* Equivalent to {@link Closeable#close()}, except any exceptions will be ignored. This is
* typically used in finally blocks.
* @param closeable A {@link Closeable} to close.
*/
public static void closeQuietly(final Closeable closeable) {
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (final IOException e) {
Log.e("Couldn't close closeable.", e);
}
}
示例7: doInBackground
import com.activeandroid.util.Log; //导入方法依赖的package包/类
@Override
protected Void doInBackground(String... strings) {
String url = strings[0];
publishProgress(0);
OkHttpClient httpClient = new OkHttpClient();
Call call = httpClient.newCall(new Request.Builder().url(url).get().build());
try {
Response response = call.execute();
InputStream stream = response.body().byteStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
List<Sentence> sentences = new ArrayList<>();
int order = 0;
String line;
while ((line = reader.readLine()) != null) {
order += 1;
sentences.add(parseSentence(order, line));
if (sentences.size() == PROGRESS_EVERY) {
importSentences(sentences);
publishProgress(order);
}
}
importSentences(sentences);
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
Toast.makeText(activity, R.string.error_retrieving, Toast.LENGTH_SHORT).show();
return null;
}
dao.reloadCollectionCounter(collection);
return null;
}
示例8: copyAttachedDatabase
import com.activeandroid.util.Log; //导入方法依赖的package包/类
public void copyAttachedDatabase(Context context, String databaseName) {
final File dbPath = context.getDatabasePath(databaseName);
// If the database already exists, return
if (dbPath.exists()) {
return;
}
// Make sure we have a path to the file
dbPath.getParentFile().mkdirs();
// Try to copy database file
try {
final InputStream inputStream = context.getAssets().open(databaseName);
final OutputStream output = new FileOutputStream(dbPath);
byte[] buffer = new byte[1024];
int length;
while ((length = inputStream.read(buffer)) > 0) {
output.write(buffer, 0, length);
}
output.flush();
output.close();
inputStream.close();
}
catch (IOException e) {
Log.e("Failed to open file", e);
}
}
示例9: executeSqlScript
import com.activeandroid.util.Log; //导入方法依赖的package包/类
private void executeSqlScript(SQLiteDatabase db, String file) {
try {
final InputStream input = Cache.getContext().getAssets().open(MIGRATION_PATH + "/" + file);
final BufferedReader reader = new BufferedReader(new InputStreamReader(input));
String line = null;
while ((line = reader.readLine()) != null) {
db.execSQL(line.replace(";", ""));
}
}
catch (IOException e) {
Log.e("Failed to execute " + file, e);
}
}
示例10: executeSqlScript
import com.activeandroid.util.Log; //导入方法依赖的package包/类
private void executeSqlScript(SQLiteDatabase db, String file) {
InputStream stream = null;
try {
stream = Cache.getContext().getAssets().open(MIGRATION_PATH + "/" + file);
if (Configuration.SQL_PARSER_DELIMITED.equalsIgnoreCase(mSqlParser)) {
executeDelimitedSqlScript(db, stream);
} else {
executeLegacySqlScript(db, stream);
}
} catch (IOException e) {
Log.e("Failed to execute " + file, e);
} finally {
IOUtils.closeQuietly(stream);
}
}