现在我正在使用一个静态布尔值来告知初始化发生的时间.有没有更简单的方法知道我已经调用了初始化?
谢谢!!!
解决了!!!!非常感谢你的评论.您需要在扩展应用程序的类中初始化解析,然后将其作为应用程序(而不是其他活动)添加到清单文件中.
🙂
这是我使用Parse的课程:
package com.example.myapp;
import com.parse.Parse;
import android.app.Application;
public class UseParse extends Application {
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "id", "key");
}
}
这是我的Android清单文件
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0"
>
android:targetSdkVersion="14"/>
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
android:name="com.example.myapp.permission.C2D_MESSAGE" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:name ="com.example.myapp.UseParse"
android:theme="@style/AppTheme" >
android:screenOrientation="portrait"
android:name="com.example.myapp.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme" >
//... more
android:permission="com.google.android.c2dm.permission.SEND">