I met this problem before because you are using the latest Parse api. A few changes need to be made.
Firstly, in order to fix the error directly caused by push from the Parse backend, you need to declare a notification icon for parsing in the manifest.
<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/ic_launcher"/>
before the closing tag application.
Issuing another push from the backend will now give you a push notification as you expect. So far, so good. When you click this button, the application will crash again. To fix this, you need to remove the now obsolete call to PushService.setDefaultPushCallback(...) and add your own Receiver class. I did this in the * .util package just like the following:
public class Receiver extends ParsePushBroadcastReceiver { @Override public void onPushOpen(Context context, Intent intent) { Intent i = new Intent(context, MainActivity.class); i.putExtras(intent.getExtras()); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } }
Then change the default Parse receiver to the one you just created: - Go to the manifest file.
<receiver android:name="your.package.name.utils.Receiver" 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" /> </intent-filter> </receiver>
source share