一般在收到采用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.
上一篇:Android的发展:我怎样才能让一个EditText平原所以它只是一个白色正方形?是一个、正方形、平原、它只
下一篇:安卓:MPEG4Writer失败使用OMX codeC作为MediaSource的时候开始时候、OMX、MPEG4Writer、MediaSource