我对ParseBroadcastReceiver
有疑问。一切正常,直到使用API27。现在我们得到java.lang.RuntimeException
,并且每次进入睡眠状态和唤醒设备后应用都会崩溃。
贝娄是我的代码。
在我的Application类中
public class PopeApp extends Application {
public void onCreate(){
Parse.enableLocalDatastore(this);
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId(Defines.parseApplicationID)
.clientKey(Defines.parseClientKey)
.server(Defines.parseURL)
.build()
);
}
}
AndroidManifest.xml
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="1" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!-- IMPORTANT: Change "com.parse.starter" to match your app's package name. -->
<category android:name="com.MidCenturyMedia.Shopper.light" />
</intent-filter>
</receiver>
答案 0 :(得分:0)
这是Stack Trase:
android.app.ActivityThread.handleReceiver(ActivityThread.java:3290)
android.app.ActivityThread.-wrap20(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1715)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)