Avatar of InfoTechEE
InfoTechEE
 asked on

postDelayed

I have a couple questions about postDelayed, see context below.

1. What is postDelayed?
2. What is it used for?
3. When should it be used? In other wods, in what circumstances should it be used?
4. What is "new Runnable()"?
5. Don't you have to declare a Runnable variable first? e.x. Runnable r = new Runnable()
6. What is public void run() if it never gets called. In other words, what's the point of creating a "run" method if it never gets called explicitly. Does it get called implicitly somewhere?

public void onClick(View v)
{
    ToggleButton.postDelayed(new Runnable()
       {
           public void run()
           {
              // do something
           }
        }
}
Android

Avatar of undefined
Last Comment
Santhana

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Santhana

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61