android-windowmanager

Flags to show a view on top of lock screen

别等时光非礼了梦想. 提交于 2019-12-09 19:04:55
问题 I am trying to add a view(ImageButton for example) to Window using WindowManager.addView(button) , What are the layout params so that the button can be seen on "lock screen". Thanks in advance. 回答1: You can try adding type as WindowManager.LayoutParams.TYPE_SYSTEM_ERROR in the WindowManager.LayoutParams constructor which is illustrated below : WindowManager.LayoutParams params=new WindowManager.LayoutParams(); params.type=WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; The aforementioned lines

How many WindowInsets are there?

风格不统一 提交于 2019-12-09 14:18:12
问题 I do not understand about WindowInsets rects, because docs says that: The system window inset represents the area of a full-screen window that is partially or fully obscured by the status bar, navigation bar, IME or other system windows. So, multiple WindowInsets can be there each with its own rect (one for status bar, another for Navigation Bar ...), and how can I retrieve them? Or is there only one WindowInsets and its left-top-right-bottom coordinates are the rect of the available window

How to detect backbutton/home press from a service like messenger chat head service?

本秂侑毒 提交于 2019-12-09 11:41:41
问题 I have been looking through several stackoverflow question to find out how can I listen to backpress button on a service using windows manager. Most of the answers proposes that it's not possible, however I can see that messenger handle it very well. How does messenger handle the backpress button on it's head chat service? (Or I am completely wrong and they are not a service using windows manager?) 回答1: To achieve what you need, you need to extend some ViewGroup that you are going to use as a

WindowManager not allowing to pass touch

拈花ヽ惹草 提交于 2019-12-09 07:03:40
问题 I have drawn an overlay using WindowManager. it's width and height are WindowManager.LayoutParams.MATCH_PARENT with transparent background. My view must be match parent and handle circle touch listener and pass the rest touch to the below screen I have two small circle in left and right corner . I make them draggable on screen that's working fine. But when I click on visible Home Screen button. WindowManager don't let the visible item clickable. int LAYOUT_FLAG = Build.VERSION.SDK_INT >=

Android: Overlay TextView on LockScreen

余生长醉 提交于 2019-12-09 04:40:52
问题 Im trying to overlay a TextView on top of the LockScreen (Similar to how Android Overlays the time). Note: I dont want to by-pass the lockscreen, but just draw on top of it (without interfering with any of the touch events). I've tried using the following flags (in onCreate): getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); getWindow(

Show facebook like chat head from a broadcast receiver in android

◇◆丶佛笑我妖孽 提交于 2019-12-08 07:48:49
问题 I am following this tutorial to implement facebook like chat head. When I start the service from an activity it just work fine. But when I start it from a broadcast receiver the chat head is not showing.And when I open the app it shows.Can I show the chat head from a broadcast receiver, without using an activity? Actaully Iam using this feature like a callerid window. So that it will show up when I receive a call. Here is ChatHead service, public class CallerIDService extends Service {

Android Resize View in Windowmanager

与世无争的帅哥 提交于 2019-12-07 17:50:42
问题 Here is my code : menubuttonClosed = li.inflate(R.layout.menu_button, null); menubutton = (ImageButton) menubuttonClosed.findViewById(R.id.menubutton); params = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,// | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, PixelFormat.TRANSLUCENT); params.x = 0; params.y = 0; params.gravity =

Cannot remove a view attached by windowManager.addView()

↘锁芯ラ 提交于 2019-12-07 12:01:10
问题 I'm trying to remove a layer added to WindowManager. But nothing happens when I call removeView(). Does anybody know how to remove it? My code looks like this. public class MainActivity extends Activity implements View.OnClickListener{ private WindowManager wm; private WindowManager.LayoutParams orientationLayout; private LinearLayout orientationChanger; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // init landscape things wm =

Android overlay on top of software buttons

六月ゝ 毕业季﹏ 提交于 2019-12-07 08:55:19
问题 I am trying to write an app that draws a custom mouse pointer. I currently have a service that creates a class that extends ViewGroup and uses the WindowManager system service to display it as a TYPE_SYSTEM_OVERLAY with the FLAG_LAYOUT_IN_SCREEN set. This almost works. On my tablet (Samsung Galaxy Tab 7.7) and in the emulator set to tablet mode, it is laid above everything except the bottom status bar (with the soft home, back keys and the notification area). In the emulator, there are no

Why would Application sometimes restart on killProcess?

会有一股神秘感。 提交于 2019-12-06 21:52:09
问题 Ordinarily, exiting my application by calling: android.os.Process.killProcess(android.os.Process.myPid()); performs well without incident. But every once in a while, the application will restart again (after exiting!). The relevant log snippet shows: .631: I/Process(15495): Sending signal. PID: 15495 SIG: 9 .641: W/AudioFlinger(121): write blocked for 252 msecs, 1279 delayed writes, thread 0xdc18 .651: I/ActivityManager(164): Process com.ef.myapp (pid 15495) has died. .651: I/WindowManager