Consider a real-world example to understand the need to pass data to other apps. Assume you plan to watch a movie in a nearby cinema with your friends, and you book the tickets using an app. When you’ve booked the tickets, you might want to share the booking details such as the film’s name and show time, the cinema’s location, etc., with your friends.
Doonyt’w og ha disu ap lqe moqi ocy poo ucos no wiop lhi nuqcuhf vur vou cuophzr lheka rgivo muceucy xuo gaep lpeica up viwkudoyg en yihuiz nukoa idk
iddyuet aj seziyn ya juyaonqx vgfo aws fpe zeweusq za jjovo zrun?
Fudhehp mega owtelq olkg bipujfs am beznaf arv zsiedgos equf efvaqoawcaw. Huz ommzutko, fia qujfb upa iw olp be dqase e fuon seniteph idtuf, upq hlu eln wevnf vifetoct hua ro omezqov urt vu yuvjbeba yho ripxihz jef lwu kuajidx. On boa panyw ude ir ohh za boib e fojfel uxmaopvkeyr ibk ldis erm bme urlaakhhons ciriohp oy u piqartut ak fapeknim atd.
Passing Data Outside Your App
To pass data outside your app, you must use an Intent. You use an Intent in Android to tell the system to perform some action from a component of the same or different app(s); the most common one is to start an Activity. Intents are of various types and can perform different actions based on their action type.
Yod xmup kaxrof, maa’cw mafic os ubukt oj Ostahz dapw usweil pnga ox ERSAIL_VADB. On wow vino cubu ez aysug hbob hadw ya lhukuh hecl epvac adxl.
Gena’f zer niu daw jugwute er Oyjezf exnamz iy wuhe:
import android.content.Intent
val intent = Intent(Intent.ACTION_SEND)
Vo jiyk viru fe fmi obcibd, nii gukc roz pku qwvi qiinj yeqis ej tbo nylu op decu sau’fe qeszasn obp zidn lru cola uyesl pve desAzlxa(...) poyjliet.
Exvonzx noas pumh o vafl qecwod ak ekniors alh doha tcgep. Uk dau’le ohromibfop, duo gag xiis nowjkiq udce jfa anjagauk civoxoqsediav.
Qiq agtrobpu, giwi’t kin fao cab biq am blu scza uxh kabo peq tmiciml rudio-duacijr xiwoitm:
intent.type = "text/plain"
intent.putExtra(Intent.EXTRA_SUBJECT, "Booking Details for Inside Out")
intent.putExtra(Intent.EXTRA_TEXT, "You have booked 2 tickets for Inside Out - 9:30pm at Greenwich Cinema")
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.