super.onCreate();
mHandler.sendEmptyMessageDelayed(MSG_TICK, TICK_DELAY);
final WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
final Display display = wm.getDefaultDisplay();
// Make a fake window that is always around eating graphics resources.
FakeView view = new FakeView(this);
Dialog dialog = new Dialog(this, android.R.style.Theme_Holo_Dialog);
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
dialog.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
| WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
| WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
| WindowManager.LayoutParams.FLAG_DIM_BEHIND);
dialog.getWindow().setDimAmount(0);
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
int maxSize = display.getMaximumSizeDimension();
maxSize *= 2;
lp.x = maxSize;
lp.y = maxSize;
lp.setTitle(getPackageName() + ":background");
dialog.getWindow().setAttributes(lp);
dialog.getWindow().setContentView(view);
dialog.show();