2012/01/20

android.widget.Toast.LENGTH_SHORT | LENGTH_LONG は何秒か?

実際、android.widget.Toast.LENGTH_SHORTとandroid.widget.Toast.LENGTH_LONGは何秒なのか?
  • com.android.server.NotificationManager#scheduleTimeoutLocked()
    private void scheduleTimeoutLocked(ToastRecord r, boolean immediate)
    {
        Message m = Message.obtain(mHandler, MESSAGE_TIMEOUT, r);
        long delay = immediate ? 0 : (r.duration == Toast.LENGTH_LONG ? LONG_DELAY : SHORT_DELAY);
        mHandler.removeCallbacksAndMessages(r);
        mHandler.sendMessageDelayed(m, delay);
    }
    
  • com.android.server.NotificationManager.LONG_DELAY, SHORT_DELAY
    private static final int LONG_DELAY = 3500; // 3.5 seconds
    private static final int SHORT_DELAY = 2000; // 2 seconds
    
  • 2秒と3.5秒なのかな?


see also: android.widget.Toast

0 件のコメント :

コメントを投稿