Code example for WindowManager

Methods: addView

0
        WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
        WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
        PixelFormat.TRANSPARENT);
       
    params.gravity=Gravity.FILL_HORIZONTAL|Gravity.FILL_VERTICAL;
    mgr.addView(v, params);
     
    // stopSelf(); -- uncomment for "component-less" operation 
  } 
 
  @Override 
  public IBinder onBind(Intent intent) {
    return(null); 
  } 
 
  @Override 
  public void onDestroy() { 
    mgr.removeView(v);  // comment out for "component-less" operation
     
    super.onDestroy(); 
  }