Interface world Java + Android, Level 1: Callback method !
Callback method:
"Don't call me, I'll call you".
Main thread starts another thread to do something, when the
worker thread finishes, it calls the result back to the main thread.
Java implement:
Step 1. Create a class as a worker.
Step 2. Create a callback interface.
Step 3. Worker class do something and call result back.
Step 4. Make callback deeper.
Main thread doesn't know + doesn't care how and what thread is actually
did the work, it just handles the result, that's all.
Android implement:
Step 1. Create MainActivity + a button to show custom dialog with 3 options.
Step 2. Create a custom dialog.
Step 3. Create a callback interface.
Step 4. Integrate callback and handle result.
Step 5. Make callback deeper.
Main activity doesn't know + doesn't care how many dialogs is opened
to let user select, it just handle the final result.
Example application: https://play.google.com/store/apps/de...
Please like, share and subscribe !
On this page of the site you can watch the video online Interface world (Java + Android), Level 1: Callback method with a duration of hours minute second in good quality, which was uploaded by the user Low Code High Value 23 April 2017, share the link with friends and acquaintances, this video has already been watched 15,753 times on youtube and it was liked by 153 viewers. Enjoy your viewing!