2013年8月15日星期四

Android Simultaneously display multiple Toast , hoping displayedsimultaneously on the screen instead of sequentially display , how to do ?

Multiple toast displayed simultaneously , the default is the toast chronological order showing that the effect is not good . I hope to do a follow different positions, but can be simultaneously displayed on the screen. How to do ?
------ Solution ---------------------------------------- ----
        if (mNextView == null) {
            throw new RuntimeException("setView must have been called");
        }

        INotificationManager service = getService();
        String pkg = mContext.getPackageName();
        TN tn = mTN;
        tn.mNextView = mNextView;

        try {
            service.enqueueToast(pkg, tn, mDuration);
        } catch (RemoteException e) {
            // Empty
        }


see the name to know the toast is put into a queue, which shows

write their own window , right
------ For reference only ------------------------------ ---------
floor himself stood
------ For reference only --------------------- ------------------

Toast toast =
         Toast.makeText(this, "toast content here",  Toast.LENGTH_SHORT);

// or something alike
toast.setGravity(Gravity.TOP | Gravity.CENTER, 80, 80);

toast.show();

------ For reference only -------------- -------------------------


I say also shows ah , pro, at least two toast.
------ For reference only --------------------- ------------------
I have encountered this problem, seeking answers

没有评论:

发表评论