I want to impose a view on my entire application, including all the actions. Think of it as a HUD (Head Up Display) on my application. The application has several actions, including tab activity, and the HUD does not interact with the user in any way; it simply displays information, allowing the user to interact with the application as usual. I want this HUD for debugging, so I (and others) can track application activity and indicate when the phone is not connected to the debugging machine (field testing).
How do I add this view?
I tried using WindowManager.addView () as follows:
WindowManager.LayoutParams lp = new WindowManager.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT); windowManager.addView(hudView, lp);
But the HUD does not seem to persist in the foreground, when I start new actions, it just disappears.
source share