Code example for WindowManager

Methods: addView

0
 
        //把影像ImagView添加到当前视图中 
        ImageView imageView = new ImageView(getContext());
        imageView.setImageBitmap(bm);
        mWindowManager = (WindowManager)getContext().getSystemService("window");
        mWindowManager.addView(imageView, mWindowParams);
        //把影像ImageView引用到变量drawImageView,用于后续操作(拖动,释放等等) 
        mDragImageView = imageView;
    } 
 
    /** 
     *  * 停止拖动,去除拖动项的头像 
     *   */ 
    public void stopDrag(){ 
        if (mDragImageView != null) {
            mWindowManager.removeView(mDragImageView);
            mDragImageView = null;
        } 
    } 
 
    /**