示例#1
0
 public virtual void removeViewImmediate(android.view.View view)
 {
     lock (this)
     {
         int index = findViewLocked(view, true);
         android.view.ViewRootImpl root    = mRoots[index];
         android.view.View         curView = root.getView();
         root.mAddNesting = 0;
         root.die(true);
         finishRemoveViewLocked(curView, index);
         if (curView == view)
         {
             return;
         }
         throw new System.InvalidOperationException("Calling with view " + view + " but the ViewAncestor is attached to "
                                                    + curView);
     }
 }
示例#2
0
 internal virtual android.view.View removeViewLocked(int index)
 {
     android.view.ViewRootImpl root = mRoots[index];
     android.view.View         view = root.getView();
     // Don't really remove until we have matched all calls to add().
     root.mAddNesting--;
     if (root.mAddNesting > 0)
     {
         return(view);
     }
     if (view != null)
     {
         android.view.inputmethod.InputMethodManager imm = android.view.inputmethod.InputMethodManager
                                                           .getInstance(view.getContext());
         if (imm != null)
         {
             imm.windowDismissed(mViews[index].getWindowToken());
         }
     }
     root.die(false);
     finishRemoveViewLocked(view, index);
     return(view);
 }