简体   繁体   English

使用Parse.com推送通知时未调用onnewIntent方法

[英]onnewIntent method is not called when using Parse.com push notification

Hi I am developing an android app to receive the push notification from parse.com with below requirement . 嗨,我正在开发一个Android应用程序,以从parse.com接收具有以下要求的推送通知。

application have two activity say A and B. when i launch my application activity A will be displayed and then activity B when i click button on activity A. 应用程序有两个活动,分别是A和B。当我启动我的应用程序时,将显示活动A,然后在我单击活动A上的按钮时显示活动B。

I want to open activity B when i receive push notification message and display on it whether my app running in background or not. 无论我的应用程序是否在后台运行,我都想在收到推送通知消息时打开活动B并在其上显示。

if running on background/or not how can i do that in both the cases. 如果在后台运行/或者不运行,在两种情况下我该怎么做。

Please help me. 请帮我。

Method onNewIntent() will be called is case: 在这种情况下,将调用onNewIntent()方法:

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(). 对于在其程序包中将launchMode设置为“ singleTop”的活动,或者在客户端调用startActivity()时使用FLAG_ACTIVITY_SINGLE_TOP标志的活动,将调用此方法。
In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it. 在这两种情况下,当在活动堆栈的顶部重新启动活动而不是启动活动的新实例时,将使用已用于重新启动的Intent在现有实例上调用onNewIntent()它。

If instance of your activity B isn't exist then onCreate() will be called. 如果您的活动B的实例不存在,则将调用onCreate()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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