Code example for WindowManager

Methods: removeView

0
    @Override 
    public void onDestroy() { 
        unregisterReceiver(mBarShownReceiver);
        if (mDemoButton != null) {
            WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
            wm.removeView(mDemoButton);
            mDemoButton = null;
        } 
    } 
 
    @Override 
    public void onLowMemory() { 
        // this service is not that important, so stop ourself when 
        // system resources are tight 
        stopSelf();
    } 
 
    @Override 
    public int onStartCommand(Intent intent, int flags, int startId) {
        final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
        WindowManager.LayoutParams params = new WindowManager.LayoutParams(