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 30
30
import java .util .HashSet ;
31
31
import java .util .List ;
32
32
import java .util .Set ;
33
+ import java .util .concurrent .Callable ;
33
34
34
35
import bolts .Continuation ;
35
36
import bolts .Task ;
@@ -402,13 +403,14 @@ public static void initialize(Configuration configuration) {
402
403
// Make sure the data on disk for Parse is for the current
403
404
// application.
404
405
checkCacheApplicationId ();
405
- new Thread ("Parse.initialize Disk Check & Starting Command Cache" ) {
406
+ final Context context = configuration .context ;
407
+ Task .callInBackground (new Callable <Void >() {
406
408
@ 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 ;
410
412
}
411
- }. start ( );
413
+ });
412
414
413
415
ParseFieldOperations .registerDefaultDecoders ();
414
416
@@ -600,6 +602,10 @@ static void checkCacheApplicationId() {
600
602
*/
601
603
/* package */ static ParseEventuallyQueue getEventuallyQueue () {
602
604
Context context = ParsePlugins .Android .get ().applicationContext ();
605
+ return getEventuallyQueue (context );
606
+ }
607
+
608
+ private static ParseEventuallyQueue getEventuallyQueue (Context context ) {
603
609
synchronized (MUTEX ) {
604
610
boolean isLocalDatastoreEnabled = Parse .isLocalDatastoreEnabled ();
605
611
if (eventuallyQueue == null
You can’t perform that action at this time.
0 commit comments