1

我的应用程序返回我当前在 Toast 对话框中显示的状态消息集合。但是,状态消息的数量正在稳步增加,这使得 Toast 成为不太可行的选择。

我想要做的是创建一个在 ListView 中显示消息的对话框。但是,我创建的任何对话框都显示在活动之上,因此当我更改活动时,对话框会丢失。如何像 Toast 那样创建一个在活动中保持可见性的对话框?

4

1 回答 1

1

It seems you are looking for some kind of notification service that already exists in Android. You can solve this on different levels:

In App

  • for Example create a BaseActivity that always has some sort of list that contains the messages you want the user to see, and extend for the activities you want. And keep some kind of a Queue for unread messages. How you visualize this is completely up to you.

Use the systems notification and consider Updating notifications.

于 2013-07-29T11:37:22.527 回答