diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java index 8052fe7b..28dcff8f 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java @@ -19,6 +19,7 @@ package de.k3b.android.androFotoFinder; +import android.app.Activity; import android.app.Application; import android.content.Context; import android.database.sqlite.SQLiteDatabase; @@ -37,6 +38,7 @@ import de.k3b.LibGlobal; import de.k3b.android.GuiUtil; import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader; +import de.k3b.android.androFotoFinder.queries.ContentProviderMediaImpl; import de.k3b.android.androFotoFinder.queries.DatabaseHelper; import de.k3b.android.androFotoFinder.queries.FotoSql; import de.k3b.android.androFotoFinder.queries.FotoSqlBase; @@ -155,7 +157,10 @@ public static RefWatcher getRefWatcher(Context context) { mCrashSaveToFile = new LogCat(Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG, PhotoViewAttacher.LOG_TAG, CupcakeGestureDetector.LOG_TAG, LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG, - ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG) { + ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG, + FotoSql.LOG_TAG, + MediaImageDbReplacement.LOG_TAG, + ContentProviderMediaImpl.LOG_TAG) { @Override public void uncaughtException(Thread thread, Throwable ex) { @@ -165,13 +170,14 @@ public void uncaughtException(Thread thread, Throwable ex) { super.uncaughtException(thread, ex); } - public void saveToFile() { + public void saveToFile(Activity activity) { final File logFile = getOutpuFile(); String message = (logFile != null) ? "saving errorlog ('LocCat') to " + logFile.getAbsolutePath() : "Saving errorlog ('LocCat') is disabled. See Settings 'Diagnostics' for details"; Log.e(Global.LOG_CONTEXT, message); - Toast.makeText(AndroFotoFinderApp.this , message, Toast.LENGTH_LONG).show(); + final Context context = (activity != null) ? activity : AndroFotoFinderApp.this; + Toast.makeText(context, message, Toast.LENGTH_LONG).show(); saveLogCat(logFile, null, mTags); } @@ -226,9 +232,9 @@ public void onTerminate() { super.onTerminate(); } - public void saveToFile() { + public void saveToFile(Activity activity) { if (mCrashSaveToFile != null) { - mCrashSaveToFile.saveToFile(); + mCrashSaveToFile.saveToFile(activity); } } public void clear() { diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java index bdd79fa9..3ead356f 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/SettingsActivity.java @@ -427,7 +427,7 @@ private void onDebugClearLogCat() { private void onDebugSaveLogCat() { Log.e(Global.LOG_CONTEXT, "SettingsActivity-SaveLogCat(): " + ActivityWithCallContext.readCallContext(getIntent())); - ((AndroFotoFinderApp) getApplication()).saveToFile(); + ((AndroFotoFinderApp) getApplication()).saveToFile(this); } private void onTranslate() { diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java index 8e8038b8..a9cd82b2 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java @@ -41,6 +41,7 @@ * Static Implementation of Context.getContentResolver()-ContentProvider based media api */ public class ContentProviderMediaImpl { + public static final String LOG_TAG = FotoSql.LOG_TAG + "Content"; private static final String MODUL_NAME = ContentProviderMediaImpl.class.getName(); public static Cursor createCursorForQuery( @@ -82,7 +83,7 @@ static Cursor createCursorForQuery( QueryParameter.toString(sqlSelectColums, null, from, sqlWhereStatement, sqlWhereParameters, sqlSortOrder, query.getCount())); if (out_debugMessage == null) { - Log.i(Global.LOG_CONTEXT, message.toString(), excpetion); + Log.i(LOG_TAG, message.toString(), excpetion); } // else logging is done by caller } } @@ -108,7 +109,7 @@ public static int exexUpdateImpl(String dbgContext, Context context, ContentValu excpetion = ex; } finally { if ((excpetion != null) || ((dbgContext != null) && (Global.debugEnabledSql || LibGlobal.debugEnabledJpg))) { - Log.i(Global.LOG_CONTEXT, dbgContext + ":" + + Log.i(LOG_TAG, dbgContext + ":" + MODUL_NAME + ".exexUpdate " + excpetion + "\n" + QueryParameter.toString(null, values.toString(), FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, @@ -155,7 +156,7 @@ public static Uri execInsert(String dbgContext, Context context, ContentValues v excpetion = ex; } finally { if ((excpetion != null) || Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + ":" + + Log.i(LOG_TAG, dbgContext + ":" + MODUL_NAME + ".execInsert " + excpetion + " " + values.toString() + " => " + result + " " + excpetion, excpetion); @@ -187,7 +188,7 @@ public static int deleteMedia(String dbgContext, Context context, String where, delCount = context.getContentResolver() .delete(FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE, lastUsedWhereClause, lastSelectionArgs); if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + "-b: " + + Log.i(LOG_TAG, dbgContext + "-b: " + MODUL_NAME + ".deleteMedia delete\n" + QueryParameter.toString(null, null, FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, @@ -197,7 +198,7 @@ public static int deleteMedia(String dbgContext, Context context, String where, delCount = context.getContentResolver() .delete(FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE, lastUsedWhereClause, lastSelectionArgs); if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + ": " + + Log.i(LOG_TAG, dbgContext + ": " + MODUL_NAME + ".deleteMedia\ndelete " + QueryParameter.toString(null, null, @@ -213,7 +214,7 @@ public static int deleteMedia(String dbgContext, Context context, String where, QueryParameter.toString(null, null, FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, lastUsedWhereClause, lastSelectionArgs, null, -1) + " : " + ex.getMessage(); - Log.e(Global.LOG_CONTEXT, msg, ex); + Log.e(LOG_TAG, msg, ex); } return delCount; @@ -262,7 +263,7 @@ private static int _del_execRenameFolder_batch_not_working(Context context, Stri .build()); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, dbgContext + "-getAffected error :", ex); + Log.e(LOG_TAG, dbgContext + "-getAffected error :", ex); return -1; } finally { if (c != null) c.close(); @@ -273,7 +274,7 @@ private static int _del_execRenameFolder_batch_not_working(Context context, Stri } catch (Exception ex) { // java.lang.IllegalArgumentException: Unknown authority content://media/external/file // i assume not batch support for file - Log.e(Global.LOG_CONTEXT, dbgContext + "-updateAffected error :", ex); + Log.e(LOG_TAG, dbgContext + "-updateAffected error :", ex); return -1; } return ops.size(); @@ -291,7 +292,7 @@ public static ContentValues getDbContent(Context context, final long id) { return values; } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, MODUL_NAME + + Log.e(LOG_TAG, MODUL_NAME + ".getDbContent(id=" + id + ") failed", ex); } finally { if (c != null) c.close(); diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java index f90cc2e2..dee35020 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java @@ -62,6 +62,7 @@ * Created by k3b on 04.06.2015. */ public class FotoSql extends FotoSqlBase { + public static final String LOG_TAG = Global.LOG_CONTEXT + "-sql"; public static final int SORT_BY_DATE_OLD = 1; public static final int SORT_BY_NAME_OLD = 2; @@ -298,7 +299,7 @@ public static final double getGroupFactor(final double _zoomLevel) { } if (Global.debugEnabled) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getGroupFactor(" + _zoomLevel + ") => " + result); + Log.e(FotoSql.LOG_TAG, "FotoSql.getGroupFactor(" + _zoomLevel + ") => " + result); } return result; @@ -632,7 +633,7 @@ public static QueryParameter getQuery(int queryID) { case QUERY_TYPE_GROUP_MOVE: return null; default: - Log.e(Global.LOG_CONTEXT, "FotoSql.getQuery(" + queryID + "): unknown ID"); + Log.e(FotoSql.LOG_TAG, "FotoSql.getQuery(" + queryID + "): unknown ID"); return null; } } @@ -757,7 +758,7 @@ public static boolean set(GalleryFilterParameter dest, String selectedAbsolutePa return true; default:break; } - Log.e(Global.LOG_CONTEXT, "FotoSql.setFilter(queryTypeId = " + queryTypeId + ") : unknown type"); + Log.e(FotoSql.LOG_TAG, "FotoSql.setFilter(queryTypeId = " + queryTypeId + ") : unknown type"); return false; } @@ -777,7 +778,7 @@ public static String execGetFotoPath(Uri uriWithID) { return DBUtils.getString(c,FotoSql.SQL_COL_PATH, null); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.execGetFotoPath() Cannot get path from " + uriWithID, ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.execGetFotoPath() Cannot get path from " + uriWithID, ex); } finally { if (c != null) c.close(); } @@ -803,13 +804,13 @@ public static List execGetFotoPaths(String pathFilter) { result.add(c.getString(0)); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.execGetFotoPaths() Cannot get path from: " + FotoSql.SQL_COL_PATH + " like '" + pathFilter +"'", ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.execGetFotoPaths() Cannot get path from: " + FotoSql.SQL_COL_PATH + " like '" + pathFilter + "'", ex); } finally { if (c != null) c.close(); } if (Global.debugEnabled) { - Log.d(Global.LOG_CONTEXT, "FotoSql.execGetFotoPaths() result count=" + result.size()); + Log.d(FotoSql.LOG_TAG, "FotoSql.execGetFotoPaths() result count=" + result.size()); } return result; } @@ -852,13 +853,13 @@ public static IGeoRectangle execGetGeoRectangle(StringBuilder out_debugMessage, return result; } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.execGetGeoRectangle(): error executing " + query, ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.execGetGeoRectangle(): error executing " + query, ex); } finally { if (c != null) c.close(); if (debugMessage != null) { StringUtils.appendMessage(debugMessage, "result", result); if (out_debugMessage == null) { - Log.i(Global.LOG_CONTEXT, debugMessage.toString()); + Log.i(FotoSql.LOG_TAG, debugMessage.toString()); } } } @@ -893,13 +894,13 @@ public static IGeoPoint execGetPosition(StringBuilder out_debugMessage, return result; } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.execGetPosition: error executing " + query, ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.execGetPosition: error executing " + query, ex); } finally { if (c != null) c.close(); if (debugMessage != null) { StringUtils.appendMessage(debugMessage, "result", result); if (out_debugMessage == null) { - Log.i(Global.LOG_CONTEXT, debugMessage.toString()); + Log.i(FotoSql.LOG_TAG, debugMessage.toString()); } // else logging by caller } } @@ -927,7 +928,7 @@ public static Map execGetPathIdMap(String... fileNames) { result.put(c.getString(1),c.getLong(0)); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.execGetPathIdMap: error executing " + query, ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.execGetPathIdMap: error executing " + query, ex); } finally { if (c != null) c.close(); } @@ -1062,7 +1063,7 @@ public static Long getId(Uri uriWithId) { try { imageID = (idString == null) ? null : Long.valueOf(idString); } catch (NumberFormatException e) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getId(" + uriWithId + ") => " + e.getMessage()); + Log.e(FotoSql.LOG_TAG, "FotoSql.getId(" + uriWithId + ") => " + e.getMessage()); } } return imageID; @@ -1106,7 +1107,7 @@ public static String getMinFolder(QueryParameter query, return c.getString(0); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getMinFolder() error :", ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.getMinFolder() error :", ex); } finally { if (c != null) c.close(); } @@ -1125,7 +1126,7 @@ public static long getCount(QueryParameter query) { return c.getLong(0); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getCount() error :", ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.getCount() error :", ex); } finally { if (c != null) c.close(); } @@ -1172,7 +1173,7 @@ public static CharSequence getStatisticsMessage(Context context, int prefixStrin ); } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getStatisticsMessage() error :", ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.getStatisticsMessage() error :", ex); } finally { if (c != null) c.close(); } @@ -1200,13 +1201,13 @@ private static SelectedFiles getSelectedfiles(QueryParameter query, String colna result = new SelectedFiles(paths, ids, null); } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "FotoSql.getSelectedfiles() error :", ex); + Log.e(FotoSql.LOG_TAG, "FotoSql.getSelectedfiles() error :", ex); } finally { if (c != null) c.close(); } if (Global.debugEnabled) { - Log.d(Global.LOG_CONTEXT, "FotoSql.getSelectedfiles result count=" + ((result != null) ? result.size():0)); + Log.d(FotoSql.LOG_TAG, "FotoSql.getSelectedfiles result count=" + ((result != null) ? result.size() : 0)); } return result; diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java index 92f546e9..82f2a260 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java @@ -65,6 +65,8 @@ * Therefore apm uses a copy of contentprovider MediaStore.Images with same column names. */ public class MediaImageDbReplacement implements IMediaDBApi { + public static final String LOG_TAG = FotoSql.LOG_TAG + "DB"; + private static final String MODUL_NAME = ContentProviderMediaImpl.class.getName(); private final SQLiteDatabase db; @@ -127,7 +129,7 @@ private Cursor createCursorForQuery(StringBuilder out_debugMessage, String dbgCo QueryParameter.toString(sqlSelectColums, null, Impl.table, sqlWhereStatement, selectionArgs, sqlSortOrder, count)); if (out_debugMessage == null) { - Log.i(Global.LOG_CONTEXT, message.toString(), excpetion); + Log.i(LOG_TAG, message.toString(), excpetion); } // else logging is done by caller } } @@ -155,7 +157,7 @@ public int exexUpdateImpl(String dbgContext, ContentValues values, String sqlWhe excpetion = ex; } finally { if ((excpetion != null) || ((dbgContext != null) && (Global.debugEnabledSql || LibGlobal.debugEnabledJpg))) { - Log.i(Global.LOG_CONTEXT, dbgContext + ":" + + Log.i(LOG_TAG, dbgContext + ":" + MODUL_NAME + ".exexUpdate " + excpetion + "\n" + QueryParameter.toString(null, values.toString(), FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, @@ -209,7 +211,7 @@ public Uri execInsert(String dbgContext, ContentValues values) { excpetion = ex; } finally { if ((excpetion != null) || Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + ":" + + Log.i(LOG_TAG, dbgContext + ":" + MODUL_NAME + ".execInsert " + excpetion + " " + values.toString() + " => " + result + " " + excpetion, excpetion); @@ -246,7 +248,7 @@ public int deleteMedia(String dbgContext, String where, String[] selectionArgs, lastSelectionArgs = null; delCount = db.delete(Impl.table, lastUsedWhereClause, lastSelectionArgs); if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + "-b: " + + Log.i(LOG_TAG, dbgContext + "-b: " + MODUL_NAME + ".deleteMedia delete\n" + QueryParameter.toString(null, null, FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, @@ -255,7 +257,7 @@ public int deleteMedia(String dbgContext, String where, String[] selectionArgs, } else { delCount = db.delete(Impl.table, lastUsedWhereClause, lastSelectionArgs); if (Global.debugEnabledSql || LibGlobal.debugEnabledJpg) { - Log.i(Global.LOG_CONTEXT, dbgContext + ": " + + Log.i(LOG_TAG, dbgContext + ": " + MODUL_NAME + ".deleteMedia\ndelete " + QueryParameter.toString(null, null, @@ -271,7 +273,7 @@ public int deleteMedia(String dbgContext, String where, String[] selectionArgs, QueryParameter.toString(null, null, FotoSqlBase.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE_NAME, lastUsedWhereClause, lastSelectionArgs, null, -1) + " : " + ex.getMessage(); - Log.e(Global.LOG_CONTEXT, msg, ex); + Log.e(LOG_TAG, msg, ex); } return delCount; @@ -289,7 +291,7 @@ public ContentValues getDbContent(long id) { return values; } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, MODUL_NAME + + Log.e(LOG_TAG, MODUL_NAME + ".getDbContent(id=" + id + ") failed", ex); } finally { if (c != null) c.close(); @@ -492,7 +494,7 @@ public static void clearMedaiCopy(SQLiteDatabase db) { try { db.execSQL("DROP TABLE " + table); } catch (Exception ex) { - // Log.e(Global.LOG_CONTEXT, "FotoSql.execGetFotoPaths() Cannot get path from: " + FotoSql.SQL_COL_PATH + " like '" + pathFilter +"'", ex); + // Log.e(LOG_TAG, "FotoSql.execGetFotoPaths() Cannot get path from: " + FotoSql.SQL_COL_PATH + " like '" + pathFilter +"'", ex); } finally { } } @@ -500,6 +502,7 @@ public static void clearMedaiCopy(SQLiteDatabase db) { public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastUpdate, IProgessListener progessListener) { int progress = 0; + java.util.Date startTime = new java.util.Date(); QueryParameter query = queryGetAllColumns; long _lastUpdate = (lastUpdate != null) ? (lastUpdate.getTime() / 1000L) : 0L; @@ -514,6 +517,9 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU SQLiteStatement sqlUpdate = null; SQLiteStatement lastSql = null; boolean isUpdate = false; + int itemCount = 0; + int insertCout = 0; + int updateCount = 0; // ContentValues contentValues = new ContentValues(); try { db.beginTransaction(); // Performance boost: all db-inserts/updates in one transaction @@ -521,9 +527,9 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU if (progessListener != null) progessListener.onProgress(progress, 0, context.getString(R.string.load_db_menu_title)); - c = ContentProviderMediaImpl.createCursorForQuery(null, "updateMedaiCopy", context, + c = ContentProviderMediaImpl.createCursorForQuery(null, "updateMedaiCopy-source", context, query, null, null); - int itemCount = c.getCount(); + itemCount = c.getCount(); sqlInsert = db.compileStatement(getSqlInsertWithParams()); sqlUpdate = db.compileStatement(getSqlUpdateWithParams()); @@ -533,12 +539,14 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU isUpdate = (c.getLong(colDATE_ADDED) <= _lastUpdate); if (isUpdate) { + updateCount++; lastSql = sqlUpdate; isUpdate = bindAndExecUpdate(c, sqlUpdate) > 0; // 0 affected update rows: must insert } if (!isUpdate) { + insertCout++; lastSql = sqlInsert; bindAndExecInsert(c, sqlInsert); } @@ -554,8 +562,25 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU progress++; } db.setTransactionSuccessful(); // This commits the transaction if there were no exceptions + if (Global.debugEnabledSql) { + java.util.Date endTime = new java.util.Date(); + final String message = "MediaImageDbReplacement.updateMedaiCopy(inserted:" + insertCout + + ", updated:" + updateCount + + ", toal:" + progress + + " / " + itemCount + + ") in " + ((endTime.getTime() - startTime.getTime()) / 1000) + + " Secs"; + Log.i(LOG_TAG, message); + } } catch (Exception ex) { - Log.e(Global.LOG_CONTEXT, "MediaImageDbReplacement.updateMedaiCopy cannot insert/update: " + lastSql + " from " + c, ex); + java.util.Date endTime = new java.util.Date(); + final String message = "MediaImageDbReplacement.updateMedaiCopy(inserted:" + insertCout + + ", updated:" + updateCount + + ", toal:" + progress + + " / " + itemCount + + ") in " + ((endTime.getTime() - startTime.getTime()) / 1000) + + " Secs"; + Log.e(LOG_TAG, "Cannot insert/update: " + lastSql + " from " + c + " in " + message, ex); } finally { sqlInsert.close(); sqlUpdate.close(); @@ -564,7 +589,7 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU } if (Global.debugEnabled) { - // Log.d(Global.LOG_CONTEXT, "FotoSql.execGetFotoPaths() result count=" + result.size()); + // Log.d(LOG_TAG, "FotoSql.execGetFotoPaths() result count=" + result.size()); } return progress; } diff --git a/app/src/main/java/de/k3b/android/util/LogCat.java b/app/src/main/java/de/k3b/android/util/LogCat.java index ba82e7af..81eaee9a 100644 --- a/app/src/main/java/de/k3b/android/util/LogCat.java +++ b/app/src/main/java/de/k3b/android/util/LogCat.java @@ -19,6 +19,7 @@ package de.k3b.android.util; +import android.app.Activity; import android.util.Log; import java.io.File; @@ -57,7 +58,7 @@ public LogCat(String... tags) { Thread.setDefaultUncaughtExceptionHandler(this); } - public abstract void saveToFile(); + public abstract void saveToFile(Activity activity); protected void saveLogCat(File logFile, OutputStream outputStream, String[] tags) { StringBuilder cmdline = new StringBuilder(); @@ -122,7 +123,7 @@ public void uncaughtException(Thread thread, Throwable ex) { try { // Do your stuff with the exception Log.e(mTags[0],"LogCat.uncaughtException " + ex, ex); - saveToFile(); + saveToFile(null); } catch (Exception e) { /* Ignore */ } finally {