When I connect to the database initially the Parse.com data connection works well. However, when the app is closed and then re-opened the connection to Parse does not work and either causes the app to crash or the app runs but all the data needed from the database is not loaded. Any ideas?
This is my initialisation which take place in the MainActivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Parse.enableLocalDatastore(this);
Parse.initialize(this);
} }
I have tried taking the initialising statement out to another class but this did not connect at all to Parse.com.
This is the logcat error when the app crashes:
02-02 19:04:53.545: E/AndroidRuntime(14130): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lfg.fyp.taste_a_saurus/com.lfg.fyp.taste_a_saurus.MainActivity}: java.lang.IllegalStateException: Parse#enableLocalDatastore(Context)
must be invoked before Parse#initialize(Context)