Closed Click2cloud-Eros closed 3 years ago
currently HarmonyOS doesn't provide exact alternative for View.postDelayed(..) , Instead you can achieve similar UI post functionality using ohos.eventhandler.EventHandler API, Sample Usage is as follows
EventHanlder eventhandler = new EventHandlder(EventRunner.getMainEventRunner());
eventhandler.postTask(runnable, timeInMillis);
Describe the query
I am creating a custom component in HarmonyOS using Java SDK, Where I have to perform some task after some delay with Component instance.
In Android, we have postDelayed(Runnable action, long delayMillis) method in View class. So we can achieve above requirement as follow
view.postDelayed(runnable, 100); but, In HMOS java SDK, I seen there is no any method available for delay in Component class.
So, My question is
What is the equivalent of view.postDelayed(Runnable action, long delayMillis) in harmonyos ?
Stackoverflow link here:
**** https://stackoverflow.com/questions/69069553/what-is-the-equivalent-of-view-postdelayedrunnable-action-long-delaymillis-in
Additional information
Developer Platform: Windows DevEco Studio version: 2.1 Beta 4 SDK API version: 5