可能使一个Android的通知,不叫的意图是什么?能使、不叫、意图、通知

由网友(沉默゛是我最好的保护色)分享简介:我需要把通知中的状态栏,而我的应用程序正在运行,但我不想,如果选择了它回调到我的活动。它的意思仅仅是,该应用程序正在运行的用户信息 - 基本上是一个提醒的情况下,他们preSS home键和最小化I need to put a Notification in the Status bar while my app i...

我需要把通知中的状态栏,而我的应用程序正在运行,但我不想,如果选择了它回调到我的活动。它的意思仅仅是,该应用程序正在运行的用户信息 - 基本上是一个提醒的情况下,他们preSS home键和最小化

I need to put a Notification in the Status bar while my app is running, but I don't want it to call back to my Activity if selected. Its meant to just be info to the user that the app is running - basically a reminder in case they press the home button and minimize it.

想法?

推荐答案

最后我想出一个解决这个问题,尽管它基本上是一个黑客。而不是我使用一个对话框类的意图,点设置到活动类。

I ended up coming up with a solution to this issue although its basically a hack. instead of setting the intent to point to an Activity class I'm using a Dialog class.

this.notificationIntent = new Intent(this, SomeDialog.class);

现在,如果用户通过选择的logcat通知,我可以看到启动的活动记录下来,但它似乎什么也没有发生。

Now if the user selects the notification, via the logcat, I can see the Starting Activity logged, but it appears nothing happens.

这让我发布一个通知,而我的应用程序正在运行保持,然后我就关闭它,当用户退出。

This allows me to post a notification that stays while my app is running and then I just dismiss it when the user exits.

阅读全文

相关推荐

最新文章