我與Parse.enableLocalDatastore/Parse.initialize的衆所周知的問題,爭取Parse.enableLocalDatastore拋出異常。當應用程序重新啓動
調用其中的第一次一切順利的話,即使我把他們從MainActivity,但重新啓動後Parse.enableLocalDatastore拋出一個異常,說Parse.enableLocalDatastore應該先調用:)))
我已經改變了我根據代碼給幾個建議。我創建了一個MyApp類並在那裏調用了這些調用。然後我嘗試修改AndroidManifest.xml。問題是,我不知道標籤的android:name屬性的正確格式是什麼。
這裏是我的應用程序類,從 「工作」 例如複製粘貼:
package com.android.adorjan.iskolaesjatek;
import android.app.Application;
import com.parse.Parse;
public class MyApp extends Application {
@Override
public void onCreate(){
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
//This is what Parse was complaining about
Parse.initialize(this, "KYZET9yhUrMQHHB", "1chhdVIUyMWkcXTlQdJl");
}
}
這裏是AndroidManifest.xml中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.adorjan.iskolaesjatek" >
<application
android:name="com.android.adorjan.iskolaesjatek.MyApp"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
的Android的價值,但:名字是錯的, Android工作室預計會有'class'或'interface'。我不知道如何拼寫它。
我也試過: 「.MyApp」, 「com.android.app.MyApp」 和其他很多愚蠢的。
感謝您的任何幫助。一個真正有效的例子將是一個獎金。
至少我發現該問題的解決方案並進行測試。 http://stackoverflow.com/questions/30135858/parse-error-parseenablelocaldatastorecontext-must-be-invoked-before-parse – achoraev 2015-07-30 13:45:09