我想要從Parse接收推送通知並打開List活動,並在開始活動前使用intent.putextra(「dataFromParse」)。 我能夠通過使用該接收推,但只開在MainActivity:通過單擊解析的推送通知打開活動
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
我想有這樣的作爲默認值,但也應該能夠啓動列表活動。 我也嘗試過使用客戶接收器,但接下來我只能在接收推送時直接打開活動,而不是點擊它時。
的manifest.xml:
<receiver android:name="com.example.Push android:exported="false">
<intent-filter>
<action android:name="com.example.UPDATE_STATUS" />
</intent-filter>
</receiver>
Push.java:
public class Push extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//Start activity
}
}
我不知道是我應該怎麼捕捉在後臺推送,並說,它應該打開的事當用戶單擊通知時,具有特定intent.putExtra(「dataFromParse」)的List活動。我應該在哪裏編碼以及如何編碼?在MainActivity中,在List活動中,或者與客戶接收者做其他事情?
面臨着同樣的問題,因爲任何解決辦法嗎? – arvindwill