java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference

前端 未结 2 1467
情书的邮戳
情书的邮戳 2021-02-20 06:11

Trying to load a class from Parse , however the app crashes as soon I launch it! Here is the code:

 ListView listview;
List ob;
P         


        
2条回答
  •  别跟我提以往
    2021-02-20 06:29

    Based on your comment I'm guessing you haven't initialized Parse. http://docs.parseplatform.org/android/guide/#local-datastore

       public class App extends Application {
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            // Enable Local Datastore.
            Parse.enableLocalDatastore(this);
    
            // Register any ParseObject subclass. Must be done before calling Parse.initialize()
            ParseObject.registerSubclass(YourClass.class);
    
            Parse.initialize(this, "APPLICATION_ID", "CLIENT_KEY");    
        }
    }
    

    Make sure you add your App class to the manifest

提交回复
热议问题