如何打开隔离弹出像Viber的GCM通知弹出、通知、Viber、GCM

2023-09-06 09:56:28 作者:萌仔= ̄ω ̄=

一般在收到采用Android GCM我们称之为generateNotfication将触发通知消息。

Generally upon receiving message using Android GCM we call generateNotfication that fires a notification.

我想知道的,而不是在射击通知栏通知,我想开一个孤立的弹出式窗口,因为做的Viber用户可以执行进一步的行动。

I want to know that instead of firing a notification in notification bar, I would like to open an isolated popup window, where user can perform further actions as Viber do.

至于Viber的,无论何地,用户是在收到一个短信就打开一个弹出式智能对话框,在这里你可以这样回答。

As for viber, No matter where ever a user is, upon receiving a text message it open a smart popup dialog where you can reply.

为什么我把它孤立的,因为我做的不是整个应用程序启动,只需在模式对话框形式的活动。

Why i call it isolated, because i don't the whole application to launch, just an activity in the form of modal box.

任何帮助将是非常美联社preciated。

Any help would be highly appreciated.

感谢

推荐答案

我认为你可以做到这一点,从GCM接收消息,启动一个透明的活动,并在活动中,您将创建并显示一个对话框,里面的的onCreate()。然后,当用户presses 取消按钮,你可以叫完成()来关闭活动。看这里:如何在Android中创建透明的活动?。这样,用户会觉得你刚才创建的对话框,并在实际的你会创造一个透明的活动。

I think what you can do it, on receiving a message from GCM, launch a transparent activity and from within the activity, you create and show a dialog inside onCreate(). Then when a user presses Cancel button, you can call finish() to close the Activity . See here: How to create Transparent Activity in Android? . This way to user it would feel that you have just created a dialog and in actual you would be creating a transparent activity.