Wednesday, January 16, 2013

Re: [android-developers] Re: hi friends

I believe this is the relevant code where the real toast delay is set:


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);
}


If you passed in 3000, because 3000 != Toast.LENGTH_LONG, you get a SHORT_DELAY, which is 2 seconds:

private static final int SHORT_DELAY = 2000; // 2 seconds

IOTW, the code is not expecting milliseconds at all.  If you do pass in milliseconds, it will currently do a 2 second delay.  No guarantee as to what will happen in future releases though.




On Monday, January 7, 2013 10:19:24 PM UTC-6, sree wrote:
3000 meand 3 milly seconds(1000 seconds for 1ms).It is correct.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate