I am getting the following error in my Android application using Parse:
You must register this ParseObject subclass before instantiat
You must call
ParseObject.registerSubclass(YourClassName.class);
before calling
Parse.initialize().
In addition, you need to annotate your custom class like this:
@ParseClassName("YourClassName")
public class YourClassName extends ParseObject
{
}
Finally, your custom class needs a default no-args constructor in order to be registered by ParseObject.
Reference: Subclassing Parse Object
You also have to put it in your Manifest like this:
<application
android:name="ParseApplication"
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
YOUR ACTIVITY 1
/>
<activity
YOUR ACTIVITY 2
/>
</application>
And then try swapping these following lines
Parse.enableLocalDatastore(this);
Parse.initialize(this, "key", "key");
like this:
Parse.initialize(this, "key", "key");
Parse.enableLocalDatastore(this);