简体   繁体   中英

Android app crashes without internet connection?

I am using parse backend service in my Android app. The problem I am facing is coding for push notification. Many times when there is no internet connection on the mobile device , an automatical alert appears "Unfortunately your app has stopped", without even using it or running in background/foreground. Please help.

This is the logcat:

Unable to start service com.parse.PushService@1658046d with Intent { act=com.google.android.c2dm.intent.REGISTRATION flg=0x10 pkg=com.grubcha.grubproject cmp=com.grubcha.grubproject/com.parse.PushService (has extras) }: java.lang.RuntimeException: applicationContext is null. You must call Parse.initialize(Context) before using the Parse library.

Add your keys to Application.java :

Parse.initialize(this, "APPLICATION ID", "CLIENT KEY");

See here : Parse quickstart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM