I've started using Parse recently, and I'm calling Parse.initialize
from my applications main activity onCreate
method. On my devices it works properly, but some users who tried it are getting android.os.NetworkOnMainThreadException
when Parse.initialize
is called. See strack trace here: http://crashes.to/s/fbe1eda87a0
I've tried moving the Parse initialization code to AsyncTask
, so it won't run on the main UI thread; but this resulted in the app crashing, because another part of the Parse SDK was trying to do an operation but the SDK wasn't initialized yet (I have no control over that part).
I've moved the call to Parse.initialize
to Application.onCreate
in the meantime, but not sure how that supposed to be better.
Has anyone else experienced this issue and knows how to solve it?