开发者

How to: Multiple activities in a single view?

Were looking into Android for writing a tablet based system. Part of the design is for the system to be as modular as possible. One aspect of this is to display any "STATUS" activities in a side view on the screen. It looks like I can use PackageManager queryIntentActivities() to find the activities that show status information. But, can I display these in a single view all at the same time (via a linear layout)? The acti开发者_如何学Govities would be installed in separate apk's (features).

Can this be accomplished using ActivityGroup? Is this even allowed in Android? Everything I've read implies that Activities take the whole screen or float on top. This implies only one activity can be active at a time where as the design I'm thinking of uses the activities more like widgets.


You should be to be able to do what you want with just one activity, plus multiple (background) Services (on different threads) for your status updates.

Don't worry, you can still package them in different apks. You'll just need to sign them the same way, and your apks won't even be sandboxed from each other, so they'll be able to share the same data and share the same memory footprint of just one apk.

Also, take a look at NotificationManager, I know you want to roll your own solution, and you can certainly do that if you want, but you could also just reuse/extend NotificationManager and save yourself a bunch of work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜