/** * Displays a SuperActivityToast. */ private void displaySuperToast(SuperActivityToast superActivityToast) { /* If this SuperActivityToast is somehow already showing do nothing */ if(superActivityToast.isShowing()) { return; } final ViewGroup viewGroup = superActivityToast.getViewGroup(); final View toastView = superActivityToast.getView(); if(viewGroup != null) { try { viewGroup.addView(toastView); if(!superActivityToast.getShowImmediate()) { toastView.startAnimation(getShowAnimation(superActivityToast)); } } catch(IllegalStateException e) { this.cancelAllSuperActivityToastsForActivity(superActivityToast.getActivity()); } } /* Dismiss the SuperActivityToast at the set duration time unless indeterminate */ if(!superActivityToast.isIndeterminate()) { Message message = obtainMessage(Messages.REMOVE); message.obj = superActivityToast; sendMessageDelayed(message, superActivityToast.getDuration() + getShowAnimation(superActivityToast).getDuration()); } }