如何打开隔离弹出像Viber的GCM通知 [英] How to open isolated popup on GCM notification like Viber

查看:179
本文介绍了如何打开隔离弹出像Viber的GCM通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一般在收到采用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.

这篇关于如何打开隔离弹出像Viber的GCM通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆