Display two Toast messages at once?
As Jay Patel said, it cannot be done. But there IS workaround! You can create custom Toast
which can contain any View
. That means you can have layout with two messages on different places inside one toast.
You can find how to do that here, or you can start directly with this snippet:
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.custom_toast,
(ViewGroup) findViewById(R.id.toast_layout_root));
TextView text = (TextView) layout.findViewById(R.id.text);
text.setText("This is a custom toast");
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
Short answer, No you can't
You can not show 2 Toast
at the same time. i am sure about this, i already tried, but i can display only one Toast.
But if you want to really display two toasts at the same time then you will set thread mechanism to shown one after another in the same place.