В моем приложении я создаю виджет календаря для моей активности, когда я просматриваю его до предыдущего или следующего месяца, я позволяю ему делать тост и показывать его.
Вопрос в том, что тост нужно время, чтобы показать, когда я прокручиваю его достаточно быстро, например, я прокрутил до "2012/05" и "2012/06" и прокрутил до "2012/07" без паузы, я придется ждать Тоста "2012/05", "2012/06", "2012/07", чтобы показывать по очереди медленно.
Кажется, что у android есть невидимая очередь для управления тостами
как я могу его очистить и показывать только последний тост? Могу ли я сразу показать конкретный тост без ожидания?
Я искал "android.widget.Toast.java" и нашел метод "cancel()", но, к сожалению, доза не работает, как следует.
if (t != null) {
t.cancel();
}
t = Toast.makeText(this.mContext, mHelper.getYear() + "年"
+ (mHelper.getMonth() + 1) + "月", Toast.LENGTH_SHORT);
t.show();