android Exit from full screen mode

As per below code, i can hide the TitleBar by your needs, Button full; static int vari = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); full = (Button)findViewById(R.id.fullview); full.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if(vari == 0) { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); vari = 1; }else { … Read more

What is WindowManager in android?

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 are laid out on screen. Among other things, it automatically performs window transitions and animations when opening or closing an app or rotating the screen. Every activity has a Window that … Read more

Alternative to “FLAG_BLUR_BEHIND” in Android?

ok , there is probably no alternative that uses the API , unless maybe i’ve forgetting anything. i can however use dimming , which is cool too, as written here: WindowManager.LayoutParams lp = dialog.getWindow().getAttributes(); lp.dimAmount=0.0f; dialog.getWindow().setAttributes(lp); dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

TYPE_SYSTEM_OVERLAY in ICS

To create an overlay view, when setting up the LayoutParams DON’T set the type to TYPE_SYSTEM_OVERLAY. Instead set it to TYPE_PHONE. Use the following flags: FLAG_NOT_TOUCH_MODAL FLAG_WATCH_OUTSIDE_TOUCH FLAG_NOT_TOUCH_MODAL << I found this one to be quite important. Without it, focus is given to the overlay and soft-key (home, menu, etc.) presses are not passed to … Read more

Android activity over default lock screen

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); try using this flags to disable lock screen when the activity is started. After API level 17 you can use <activity android:name=”.yourActivityName” android:showOnLockScreen=”true” android:screenOrientation=”sensorPortrait” > showOnLockScreen like in the example…

Android: Unable to add window. Permission denied for this window type

if you use apiLevel >= 19, don’t use WindowManager.LayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT which gets the following error: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@40ec8528 — permission denied for this window type Use this instead: LayoutParams.TYPE_TOAST or TYPE_APPLICATION_PANEL

What APIs are used to draw over other apps (like Facebook’s Chat Heads)?

This one: Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications. Very few applications should use this permission; these windows are intended for system-level interaction with the user. Constant Value: “android.permission.SYSTEM_ALERT_WINDOW” //EDIT: The full code here: public class ChatHeadService extends Service { private WindowManager windowManager; private ImageView … Read more