A
A
Alexander_Fomin2016-03-04 17:04:20
Android
Alexander_Fomin, 2016-03-04 17:04:20

How to display toast (Android) in parent layout only?

When displaying toast on the main activity, I go to the settings activity, but the toast is still displayed. After a while, he disappears. I display it like this: Toast.makeText(context, message, Toast.LENGTH_SHORT).show();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-03-04
@Alexander_Fomin

You can hide it yourself during the transition, through its cancel

Toast toast = Toast.makeText(m_activity, message, Toast.LENGTH_SHORT);
toast.show();
toast.cancel();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question