Try to show the SuperToast. SuperToasts will be shown using the WindowManager while
SuperActivityToasts will be shown using their supplied ViewGroup.
@param superToast the SuperToast (or SuperActivityToast) to be shown
970676
private void displaySuperToast(SuperToast superToast) {

        // Make sure the SuperToast isn't already showing for some reason
        if (superToast.isShowing()) return;

        // If the SuperToast is a SuperActivityToast, show it via the supplied ViewGroup
        if (superToast instanceof SuperActivityToast) {
            if (((SuperActivityToast) superToast).getViewGroup() == null) {
                Log.e(getClass().getName(), ERROR_SAT_VIEWGROUP_NULL);
                return;
            }

            try {
                ((SuperActivityToast) superToast).getViewGroup().addView(superToast.getView());

                // Do not use the show animation on the first SuperToast if from orientation change
                if (!((SuperActivityToast) superToast).isFromOrientationChange()) {
                    AnimationUtils.getShowAnimation((SuperActivityToast) superToast).start();
                }
            } catch (IllegalStateException illegalStateException) {
                Log.e(getClass().getName(), illegalStateException.toString());
            }

            if (!((SuperActivityToast) superToast).isIndeterminate()) {
                // This will remove the SuperToast after the total duration
                sendDelayedMessage(superToast, Messages.REMOVE_SUPERTOAST,
                        superToast.getDuration() + AnimationUtils.SHOW_DURATION);
            }

        // The SuperToast is NOT a SuperActivityToast, show it via the WindowManager
        } else {
            final WindowManager windowManager = (WindowManager) superToast.getContext()
                    .getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
            if (windowManager != null) {
                windowManager.addView(superToast.getView(), superToast.getWindowManagerParams());
            }

            // This will remove the SuperToast after a certain duration
            sendDelayedMessage(superToast, Messages.REMOVE_SUPERTOAST,
                    superToast.getDuration() + AnimationUtils.SHOW_DURATION);
        }
    }
1032296
@Override
    public void visitClassContext(ClassContext classContext) {
        if ((collectionClass == null) || (iteratorClass == null)) {
            return;
        }

        try {
            collectionGroups = new ArrayList<>();
            groupToIterator = new HashMap<>();
            loops = new HashMap<>(10);
            super.visitClassContext(classContext);
        } finally {
            collectionGroups = null;
            groupToIterator = null;
            loops = null;
            endOfScopes = null;
        }
    }
368644
public static void turnScreenOn(Activity context) {
        try {
            Window window = context.getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
            window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
            window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
        } catch (Exception ex) {
            Log.e("Caffeine", "Unable to turn on screen for activity " + context);
        }
    }
420119
@Override public Parcelable onSaveInstanceState() {
    if (isInEditMode) return null;

    VS viewState = delegateCallback.getViewState();
    if (viewState == null) {
      throw new NullPointerException("ViewState returned from getViewState() is null for MvpView "
          + delegateCallback.getMvpView());
    }

    Parcelable superState = delegateCallback.superOnSaveInstanceState();

    if (keepPresenterDuringScreenOrientationChange) {
      if (viewState instanceof RestorableParcelableViewState) {
        return new MosbyViewStateSavedState(superState, mosbyViewId,
            (RestorableParcelableViewState) viewState);
      }
      return new MosbyViewStateSavedState(superState, mosbyViewId, null);
    } else {
      return superState;
    }
  }
843233
@SuppressLint("NewApi")
    protected static boolean isActionBarSubTitle(TextView view) {
        if (matchesResourceIdName(view, ACTION_BAR_SUBTITLE)) return true;
        if (parentIsToolbarV7(view)) {
            final android.support.v7.widget.Toolbar parent = (android.support.v7.widget.Toolbar) view.getParent();
            return TextUtils.equals(parent.getSubtitle(), view.getText());
        }
        return false;
    }
1109093
public void setCurrentSubScreen(BasePanel subScreen)
    {
        m_screenParent = null;      // Screen's parent
        m_iScreenSeq = -1;
        if (subScreen != null)
            m_screenParent = subScreen.getParentScreen();   // Screen's parent
        if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getRecord() != null)
            m_screenParent = (BaseScreen)this.getOwner().getRecord().getRecordOwner();
        if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getComponent(0) instanceof ScreenField)
            m_screenParent = ((ScreenField)this.getOwner().getComponent(0)).getParentScreen();
        if (m_screenParent == null)
            return;
        int iBestGuess = -1;
        for (m_iScreenSeq = 0; m_iScreenSeq < m_screenParent.getSFieldCount(); m_iScreenSeq++)
        {
            ScreenField sField = m_screenParent.getSField(m_iScreenSeq);
            if (sField == subScreen)
                return;     // Found (m_iScreenSeq is correct)
            if (sField instanceof BaseScreen)
                iBestGuess = m_iScreenSeq;
        }
        m_iScreenSeq = iBestGuess;
    }
988036
public void rootWindowClosing(WindowEvent evt) {
        // TODO: Remove debugger from connection.
        ((ObservableReader) reader).removeReaderListener(readerListener);
        ((ObservableWriter) writer).removeWriterListener(writerListener);
    }
200862
public static void showToast(String message, int duration) {
		showToast(message, duration, null, null, null);
	}
550405
public void applyTo(final PeekViewActivity activity, final View base) {
        final GestureDetectorCompat detector =
                new GestureDetectorCompat(activity, new GestureListener(activity, base, this));

        base.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, final MotionEvent motionEvent) {
                // we use the detector for the long and short click motion events
                detector.onTouchEvent(motionEvent);

                if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
                    forceRippleAnimation(base, motionEvent);
                }

                return true;
            }
        });
    }
1205825
@Override
	public T visitParamsGroup(ParamsGroupContext ctx) {
//		on(ctx);
		appendAst(ctx, tok(PARAM_GROUP));
		return super.visitParamsGroup(ctx);
	}
508315
private static void checkedSetSuperClassDesc(ObjectStreamClass desc,
            ObjectStreamClass superDesc) throws StreamCorruptedException {
        if (desc.equals(superDesc)) {
            throw new StreamCorruptedException();
        }
        desc.setSuperclass(superDesc);
    }
169025
public void show(ViewGroup parent){
        if(mState == STATE_SHOWING || mState == STATE_DISMISSING)
            return;

        if(getParent() != parent) {
            if(getParent() != null)
                ((ViewGroup) getParent()).removeView(this);

            parent.addView(this);
        }

        show();
    }
1177311
@Override
    public void onActivityPause(Activity activity) {
        HMSAgentLog.d("autoShowFloatWindow:" + isShowFloatWindowCalled);
        showFinal(false, null, ApiClientMgr.INST.getApiClient());
    }
978649
void cancelAllSuperToasts() {
        removeMessages(Messages.SHOW_NEXT);
        removeMessages(Messages.DISPLAY_SUPERTOAST);
        removeMessages(Messages.REMOVE_SUPERTOAST);

        // Iterate through the Queue, polling and removing everything
        for (SuperToast superToast : superToastPriorityQueue) {
            if (superToast instanceof SuperActivityToast) {
                if (superToast.isShowing()) {
                    try{
                        ((SuperActivityToast) superToast).getViewGroup().removeView(superToast.getView());
                        ((SuperActivityToast) superToast).getViewGroup().invalidate();
                    } catch (NullPointerException|IllegalStateException exception) {
                        Log.e(getClass().getName(), exception.toString());
                    }
                }
            } else {
                final WindowManager windowManager = (WindowManager) superToast.getContext()
                        .getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
                if (superToast.isShowing()) {
                    try{
                        windowManager.removeView(superToast.getView());
                    } catch (NullPointerException|IllegalArgumentException exception) {
                        Log.e(getClass().getName(), exception.toString());
                    }
                }
            }
        }
        superToastPriorityQueue.clear();
    }
596736
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            stack = new OpcodeStack();
            localClassTypes = new HashMap<>();
            fieldClassTypes = new HashMap<>();
            JavaClass cls = classContext.getJavaClass();
            Method staticInit = findStaticInitializer(cls);
            if (staticInit != null) {
                setupVisitorForClass(cls);
                doVisitMethod(staticInit);
            }

            super.visitClassContext(classContext);
        } finally {
            stack = null;
            localClassTypes = null;
            fieldClassTypes = null;
        }
    }
127524
private void showGlobalContextActionBar() {
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(R.string.app_name);
    }
792706
public static void applyToOr(ColorHolder colorHolder, TextView textView, ColorStateList colorDefault) {
        if (colorHolder != null && textView != null) {
            colorHolder.applyToOr(textView, colorDefault);
        } else if (textView != null) {
            textView.setTextColor(colorDefault);
        }
    }