how can i put my PopupWindow to system desk or other app? how can i use this permission:INTERNAL_SYSTEM_WINDOW
Any examples?Thanks!
1
1
|
| ||||||
|
0
|
ok,the problem is resolved. i use WindowManager.addView in a service, and WindowManager.LayoutParams.type = TYPE_SYSTEM_ALERT, then it's ok! you can try it! | ||||||||||
|
3
|
| ||
0
|
When I implement the code posted by @yuankai and add a Button view to the layout where he has a CustomPopupView, it appears as expected, over the top of all windows and responds to click events but won't change colour when pressed as Buttons normally do. How can I update the button to change colour when depressed like its normal behaviour? | ||||||
|
8
8
|
I'm trying to create an always-op-top button/clickable-image which stays on top of all the windows all the time. The proof of concept is here http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar and here http://forum.xda-developers.com/showthread.php?t=865525 I'm following this example code http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/LoadAverageService.java;h=0d86429aaa5ccf6ecf311dfb3af0f3ccbf5f8d29;hb=HEAD I have been successful and have a running service now. The service displays some text on top left corner of screen all the time while user can freely interact with rest of apps in normal manner. What I'm doing is subclass ViewGroup and add it to root window manager with flag TYPE_SYSTEM_OVERLAY. Now I want to add a button/clickable-image in place of this text which can receive touch events on itself. I tried overriding "onTouchEvent" for the whole ViewGroup but it does not receive any event. How can I receive events only on certain parts of my always-on-top view group? Kindly suggest.
| ||||||||||
|
5
|
This might be a stupid solution. But it works. If you can improve it, please let me know. OnCreate of your Service: I have usedWindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH flag. This is the only change in service.
Now, you will start getting each and every click event. So, you need to rectify in your event handler. In your ViewGroup touch event @Override public boolean onTouchEvent(MotionEvent event) {
| ||||||||||||
|
0
|
It is not possible to get event in this fashion. You can only "display". ====== I have added a solution that worked for me. See my another reply. | ||||||||||
|
0
|
Well try my code, atleast it gives you a string as overlay, you can very well replace it with a button or an image. You wont believe this is my first ever android app LOL. Anyways if you are more experienced with android apps than me, please try
| ||||
|
http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android