android-windowmanager

How to avoid black screen in android while my app is loading?

梦想与她 提交于 2019-11-28 23:54:10
How to avoid black screen in android while my app is loading ? I have removed all things from onCreate to AsyncTask but still I have black screen at the beginning. My default ( first ) activity is Main and if there is one parameter I momentarily load Personal activity withou showing Main, otherwise I show Main activity. Can anyone suggest me solution ? I tried with http://blog.iangclifton.com/2011/01/01/android-splash-screens-done-right/ but it doesn't help. April Smith i'm not sure. but, Try this in Manifest inside your activity android:theme="@android:style/Theme.Translucent" Or android

Programmatically turn screen on in android

别说谁变了你拦得住时间么 提交于 2019-11-28 21:38:07
I am developing an alarm application. From the main activity i set the alarm using broadcast. Then in onReceive in broadcast receiver i call activity that is enabling user to shut down or snooze the alarm...In that activity, in the beginning of onCreate i use this lines to turn screen on and unlock the device: final Window win = getWindow(); win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); This works perfect on Samsung

Detect Lock Screen Incorrect Password by user in Android

流过昼夜 提交于 2019-11-28 20:56:16
I am building a security app and I need to know if the user is giving incorrect password . Suppose user phone is locked by pattern lock system , and unfortunately user has forgotten the pattern password.When user give wrong pattern 5 time, there will be a penalty for 30 sec . I need to catch that penalty event . In my app, i have to do some task (for the safety of user) when this even come . Please help me, You can set up a DeviceAdminReceiver that will be notified about failed password attempts, as well as a successful password attempt that occurred after a failed attempt. This is covered in

WindowManager$BadTokenException unable to add window

萝らか妹 提交于 2019-11-28 13:19:16
I am developing app for background videorecording ,thats why i used WindowManager,but it did not worked for me.gives following errors: 08-23 15:38:21.021: E/AndroidRuntime(4200): java.lang.RuntimeException: Unable to create service com.example.prankapp.BackgroundVideoRecorder: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@418c0b68 -- permission denied for this window type 08-23 15:38:21.021: E/AndroidRuntime(4200): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2277) 08-23 15:38:21.021: E/AndroidRuntime(4200): at android

How to add a floating view to Android Window manager and listen to System/Hardware back button events

那年仲夏 提交于 2019-11-28 06:02:31
I have a service which displays a floating view on the window manager (using WINDOW_TYPE_ALERT permission). I'm able to display it and perform actions. But, I have two specific questions: Regarding the implementation of the floating view How to listen to system back button event so that I can dismiss the view. Implementation: In the manifest I added permissions for: <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> I have a broadcast receiver which will listen for Alarm events. Upon receiving the event, I'm starting a service to display the floating view. The following

How to create an UI or a widget that sits on top of all applications in Android?

给你一囗甜甜゛ 提交于 2019-11-28 05:08:45
Can I create an UI or a widget in Android that will sit on top of all applications? There are applications that have widgets like this. One example has a camera icon on top of all the applications that, when clicked, will capture the screen. If you want to just display something, you can display it on top of everything even the lockscreen. If you want something to be clickable, you can display it on top of anything except the lockscreen. Here's a sample, modify to your needs: Create a service and do the following: //These three are our main components. WindowManager wm; LinearLayout ll;

Android Crash, java.lang.IllegalArgumentException: Window type can not be changed after the window is added

不想你离开。 提交于 2019-11-28 04:30:47
问题 I uploaded an Android Application to the market, and, for some reason a user is getting this error. java.lang.IllegalArgumentException: Window type can not be changed after the window is added. at android.os.Parcel.readException(Parcel.java:1331) at android.os.Parcel.readException(Parcel.java:1281) at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:664) at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:3594) at android.view.ViewRootImpl.performTraversals

Programmatically turn screen on in android

岁酱吖の 提交于 2019-11-27 21:00:00
问题 I am developing an alarm application. From the main activity i set the alarm using broadcast. Then in onReceive in broadcast receiver i call activity that is enabling user to shut down or snooze the alarm...In that activity, in the beginning of onCreate i use this lines to turn screen on and unlock the device: final Window win = getWindow(); win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); win.addFlags(WindowManager

android Exit from full screen mode

你说的曾经没有我的故事 提交于 2019-11-27 20:41:34
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 get normal screen from full screen. Thank you in advance. As per below code, i can hide the TitleBar

What is WindowManager in android?

人盡茶涼 提交于 2019-11-27 17:09:52
I tried googling it and there is no direct and/or clear cut answer. The developer website 's definition is not clear either: The interface that apps use to talk to the window manager. Use Context.getSystemService(Context.WINDOW_SERVICE) to get one of these. Can someone with plain 6th grade English explain what it is? And how can I use it to create a floating object that remains via several activties, even though I moved from one to the other? The Android WindowManager is a system service, which is responsible for managing the z-ordered list of windows, which windows are visible, and how they