设置Android Toast持续时间非常长(例如1分钟)(Set Android Toast duration to be really long (e.g., 1 minute))
我尝试将我的Toast节目时间设置为1分钟。 我试试这个:
final Toast toast = Toast.makeText(getApplicationContext(), "MESSAGE", Toast.LENGTH_LONG );
toast.show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
toast.cancel();
}
}, 60000);
谢谢你的帮助。
I try to set my Toast show duration like 1minute. I try this:
final Toast toast = Toast.makeText(getApplicationContext(), "MESSAGE", Toast.LENGTH_LONG );
toast.show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
toast.cancel();
}
}, 60000);
Thanks for your help.