Merge pull request #619 from dosiecki/master

Android: Bugfixes
This commit is contained in:
Samuel Clay 2014-11-18 13:44:20 -08:00
commit 1c5d6f9e77
2 changed files with 26 additions and 18 deletions

View file

@ -56,9 +56,11 @@ public class BlurDatabaseHelper {
public BlurDatabaseHelper(Context context) {
this.context = context;
dbWrapper = new BlurDatabase(context);
synchronized (RW_MUTEX) {
dbRO = dbWrapper.getRO();
dbRW = dbWrapper.getRW();
}
}
public void close() {
// when asked to close, do so via an AsyncTask. This is so that (since becoming serial in android 4.0)

View file

@ -88,6 +88,7 @@ public class FolderListFragment extends NbFragment implements OnGroupClickListen
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
try {
switch (loader.getId()) {
case SOCIALFEEDS_LOADER:
adapter.setSocialFeedCursor(cursor);
@ -105,6 +106,11 @@ public class FolderListFragment extends NbFragment implements OnGroupClickListen
throw new IllegalArgumentException("unknown loader created");
}
checkOpenFolderPreferences();
} catch (Exception e) {
// for complex folder sets, these ops can take so long that they butt heads
// with the destruction of the fragment and adapter. crashes can ensue.
Log.w(this.getClass().getName(), "failed up update fragment state", e);
}
}
@Override