You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Monkey Cache to get data for two fragments that are displayed on a tab layout with a viewpager. Both fragments are loaded at the same time even though only one is visible at any given time. However, I get a "Database Is Locked" error in Crashlytics.
I quick workaround that came to mind was to just load one fragment at a time. However, both fragments have to be loaded for the sake of showing a sliding animation.
Perhaps using a singleton with locking for accessing Monkey Cache could also alleviate the problem.
Thank you for your help.
The text was updated successfully, but these errors were encountered:
Thank you @jamesmontemagno for your reply. Yes, I'm using the Sqlite implementation. I ended up writing code to access the MonkeyCache just when the the property UserVisibleHint in the fragment is set to true.
public override bool UserVisibleHint
{
get { return base.UserVisibleHint; }
set
{
base.UserVisibleHint = value;
if (UserVisibleHint)
{
// call MonkeyCache
}
}
}
I use Monkey Cache to get data for two fragments that are displayed on a tab layout with a viewpager. Both fragments are loaded at the same time even though only one is visible at any given time. However, I get a "Database Is Locked" error in Crashlytics.
I quick workaround that came to mind was to just load one fragment at a time. However, both fragments have to be loaded for the sake of showing a sliding animation.
Perhaps using a singleton with locking for accessing Monkey Cache could also alleviate the problem.
Thank you for your help.
The text was updated successfully, but these errors were encountered: