Android应用程序崩溃没有互联网连接?
问题描述:
我在我的Android应用程序中使用解析后端服务。我面临的问题是编码推送通知。很多时候,当移动设备上没有互联网连接时,会出现一个自动提示“不幸的是,您的应用程序已停止”,甚至没有使用它或在后台/前台运行。请帮忙。Android应用程序崩溃没有互联网连接?
这是logcat的:
Unable to start service [email protected] 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.
答
钥匙添加到Application.java
:
Parse.initialize(this, "APPLICATION ID", "CLIENT KEY");
在这里看到:Parse quickstart
+0
已经添加了Anderson,然后。 –
+0
对不起,问题只是推送通知。 –
它会很高兴地看到实际的代码或至少错误信息从LogCat,否则我们不知道从哪里开始 –
我已经更新了逻辑请帮忙。 –
它似乎你没有初始化您的应用程序类中的解析。 –