android-windowmanager

Android O - FLAG_SHOW_WHEN_LOCKED is deprecated

自作多情 提交于 2019-12-17 23:32:49
问题 I'm targetting my application to Android O. In my application I have a job service that shows a window over all other applications, so when it triggered it needs to show this window even when the screen is turned off & unlocked and turn it on. I've achieved this behaviour in preior Android versions, but in Android O it doesn't work as I expected. I've read that I need to use the flag TYPE_APPLICATION_OVERLAY and added also the permission <uses-permission android:name="android.permission

Android: permission denied for window type 2038 using TYPE_APPLICATION_OVERLAY

南楼画角 提交于 2019-12-17 19:36:30
问题 I trying to create a view that is above other applications: WindowManager.LayoutParams paramsDirectorView = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT); I have looked in other responses and found the following things for "drawing over applications": I have android.permission.SYSTEM_ALERT_WINDOW in the

What does this 4 line java code means in android application?

白昼怎懂夜的黑 提交于 2019-12-17 13:38:10
问题 In my java application i have this code @Override public void onAttachedToWindow() { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); super.onAttachedToWindow(); } when i build it for android 2.3 (level 10) it compiles and works fine. But when i build it for android 4.0 (level 15) it compiles and gives me crash at run time and following error 07-16 14:00:03.090: E/AndroidRuntime(29487): FATAL EXCEPTION: main 07-16 14:00:03.090: E/AndroidRuntime(29487): java.lang

android Exit from full screen mode

六月ゝ 毕业季﹏ 提交于 2019-12-17 10:56:14
问题 I am working in Android. I need to show my activity in Full screen mode, and i did this using following code. getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Now its looking like this:- Now I want to exit from this full mode so my activity should show as before. like this:- I have a button which is used to switch between full mode or normal mode, i will switch mode again and again. Please suggest me how can i do this. Means how can

TYPE_SYSTEM_OVERLAY in ICS

霸气de小男生 提交于 2019-12-17 04:59:26
问题 In Honeycomb I was able to create a system overlay with TYPE_SYSTEM_OVERLAY and receive touches with FLAG_WATCH_OUTSIDE_TOUCH. Now ICS has changed something. I can still create the system overlay, but i can't get touches. Now, i am able to create the same with TYPE_SYSTEM_ALERT and get touches, but it just catches the touchevents, and not passing them on like in Honeycomb. Any idea's? Kind regards 回答1: Everything you describe is true. It is presumably to tighten up security, as the former

BadTokenException Unable to add Window Spinner in PopUpWindow

你离开我真会死。 提交于 2019-12-12 02:16:43
问题 I know there are a lot of similar questions here, but I'm not able to transfer the answers to my problem (or I didn't find THE answer I need...) In my menu on actionBar (in onOptionsItemSelected) I open a popupWindow for user settings. Checkbox and RadioButtons work fine, but if I tab on the Spinner, there will be a FATAL EXCEPTION: FATAL EXCEPTION: main android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@42766f00 is not valid; is your

startActvtiy in Doze mode on Android Pie

拈花ヽ惹草 提交于 2019-12-11 15:56:16
问题 I am developing a VoIP calling App. everything is fine on prior to Android Pie. On When device is in Doze (Deep Sleep) mode it received FCM and starts rising but it does not show the call Activity. How can I Show Activity on Lock Screen in Doze mode on Pie ?? I am using following Flags in my call Activity. getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager

View behave weirdly when updating its LayoutParams using WindowManager

て烟熏妆下的殇ゞ 提交于 2019-12-10 22:12:47
问题 hi,I was using WindowManager to display a floating window on the bottom of the screen, the floating window is about 120px high and the width is match_parent, so the outside of the floating window is touchable. In some cases, I need to update the window size to fullscreen to display some lists, at the same time, the original view should stay intact. I was using updateViewLayout method of WindowManager to update the layout of the floating window. The layout params of The small window is as

TYPE_SYSTEM_OVERLAY in Android 4 ICS

 ̄綄美尐妖づ 提交于 2019-12-10 20:24:55
问题 My question is similar to the one here, TYPE_SYSTEM_OVERLAY in ICS but is there any other way to achieve System overlay with touch events in ICS? There are applications in the market which use overlay like, Dock4Droid https://play.google.com/store/apps/details?id=com.urbandroid.dock and https://play.google.com/store/apps/details?id=mobi.conduction.swipepad.android 回答1: I see that TYPE_SYSTEM_ALERT still works on ICS and I need to come up with a solution using this flag. 来源: https:/

Logcat for multiple devices running at the same time in Android Studio?

只愿长相守 提交于 2019-12-10 12:57:16
问题 As title says, I'd like to have two windows inside Android studio to see log for 2 devices running at the same time, how to achieve this? At the moment i have to switch devices all the time, but its not very handy when you have to compare different values. I found this thread, but it's not working in AS: How do I get Logcat for multiple devices running at the same time in Eclipse 回答1: You can use the regular "Android" view for one device, then run your app on the other device in debug mode.