Interface world (Java + Android), Level 1: Callback method

Pubblicato il: 23 aprile 2017
sul canale di: Low Code High Value
15,753
153

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 !


In questa pagina del sito puoi guardare il video online Interface world (Java + Android), Level 1: Callback method della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Low Code High Value 23 aprile 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 15,753 volte e gli è piaciuto 153 spettatori. Buona visione!