File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Parse/src/main/java/com/parse Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 3030import java .util .HashSet ;
3131import java .util .List ;
3232import java .util .Set ;
33+ import java .util .concurrent .Callable ;
3334
3435import bolts .Continuation ;
3536import bolts .Task ;
@@ -402,13 +403,14 @@ public static void initialize(Configuration configuration) {
402403 // Make sure the data on disk for Parse is for the current
403404 // application.
404405 checkCacheApplicationId ();
405- new Thread ("Parse.initialize Disk Check & Starting Command Cache" ) {
406+ final Context context = configuration .context ;
407+ Task .callInBackground (new Callable <Void >() {
406408 @ Override
407- public void run () {
408- // Trigger the command cache to flush its contents.
409- getEventuallyQueue () ;
409+ public Void call () throws Exception {
410+ getEventuallyQueue ( context );
411+ return null ;
410412 }
411- }. start ( );
413+ });
412414
413415 ParseFieldOperations .registerDefaultDecoders ();
414416
@@ -600,6 +602,10 @@ static void checkCacheApplicationId() {
600602 */
601603 /* package */ static ParseEventuallyQueue getEventuallyQueue () {
602604 Context context = ParsePlugins .Android .get ().applicationContext ();
605+ return getEventuallyQueue (context );
606+ }
607+
608+ private static ParseEventuallyQueue getEventuallyQueue (Context context ) {
603609 synchronized (MUTEX ) {
604610 boolean isLocalDatastoreEnabled = Parse .isLocalDatastoreEnabled ();
605611 if (eventuallyQueue == null
You can’t perform that action at this time.
0 commit comments