Reputation: 957
I want to create a view which is always visible even when my application is not in foreground(Like Toast). And also I can hide this view when task completed. For Example: Like the view of CPU usage in android 4.0 which is visible on all screens in top left corner of device
Upvotes: 2
Views: 613
Reputation: 46856
Check out the StandOut library, it enables you to create applications that can hover on top of the other apps on the screen.
Once you get it imported to your project you just create a class that extends StandOutWindow
override all of the relavent methods and then to show it you call like this:
StandOutWindow.show(this, YourWindow.class, StandOutWindow.DEFAULT_ID);
The library takes care of the rest for you, and even enables your windows to be shown/hidden from the view itself or the notification bar.
Upvotes: 7