I noticed a method called Post in Android’s Button class. I was wondering what this method was for? This method takes a runnable argument, my question is when should we use this vs just having a listener bind to the click event of this button? What is the difference? Any example is appreciated.
I noticed a method called Post in Android’s Button class. I was wondering what
Share
post()is inherited fromView. It has nothing to do with button clicks and is not a replacement for anOnClickListener.post()is used to arrange for aRunnableto be executed on the main application thread, typically by some code running on a background thread.