I quit the app, relaunch it, I am getting an exception.
public void onCreate() {
-->here Parse.initialize(this, \"adfsfasdfs\",
\"asdfadfsdf\"
Parse.initialize()
should only be called once for an entire application.
Calling it in an Activity
's onCreate
function can cause it to be initialized more than once, as an Activity can be created more than once during an app's lifecycle.
Instead, create an Application class (and add an android:name
attribute to your your application's manifest).
Application: (Note not an Activity/Service/Reciever)
//Note that this is an android.app.Application class.
public class MyApplication extends android.app.Application {
@Override
public void onCreate() {
super.onCreate();
//This will only be called once in your app's entire lifecycle.
Parse.initialize(this,
getResources().getString(R.string.parse_application_id),
getResources().getString(R.string.parse_client_key));
}
AndroidManifest:
....
....