【发布时间】:2016-10-05 07:23:55
【问题描述】:
我正在开发集成 MFP 的 android 本机应用程序。 我已经实现了 MFP 推送通知,它工作正常。我收到通知。但是当我单击通知时,我的应用程序会重新启动。
实际的问题是我在启动应用程序时启动了一个启动活动,我正在初始化我的所有 MFP 内容并终止此活动,使应用程序进入登录活动。
在我的清单文件中,我将接收器定义如下。
<activity
android:name="SplashActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.mypackage.app_name.NOTIFICATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
接收器在我的启动活动中定义,但我正在完成此活动并进入登录活动,然后从登录到其他活动。现在,每次应用启动时都只会调用一次启动活动。
因此,当我单击通知时,它会杀死其他活动并再次启动启动活动,因为它被要求仅在启动活动中接收。
所以有人可以告诉我如何设计我的应用程序,以便在我进行应用程序的任何活动时收到通知(它不应该启动启动活动,而是应该在应用程序的同一活动上已打开,并调用 onrecieve 消息方法)..
请提出建议。
我之前问过类似类型的问题,但后来可以找到问题,所以我发布了这个问题,并附有实际问题寻求解决方案。 Mobilefirst PushNotification: On using wl_anonymousUserRealm at server, app is not calling onReceive method on clicking notification
【问题讨论】:
标签: android push-notification google-cloud-messaging ibm-mobilefirst