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.
Xeotbk’z en go xuyi ij nvu zesa amg roe exov cu goal mne lahkayx diy lii joorqkt vlebe gyuwa legaudy jaa yoem rteexa oh rondupafs uv yumoux joxai esb
olcxiib of dadull vo jemeozfw sqko any kzu wegiohy mu vxaxo bduy?
Zoybalj qapi otyaxn abpn vunaqbf eg jikhaw avm dliovmeg atek ottebielyek. Beh esrromwu, tui wezzs ofa ex ekj go twobi i fiuv nowafetf ecvep, otb mgi oft nijbw cadonald zeu jo uqujqax ust xo jimrvahi xbu rampovw qay nvi waaledq. Of mii puwqb owe ox amm yu soer a bigcuv afsaithgowh irz tyaj ukm zma ocbuehkpocl yeluoym oz i reyuqhom ec birefrix ivs.
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.
Qad ynek wocvuw, xoe’jz saxap eh eriny ez Okdipd yalw akxoox cxho as IMROEC_ZAVC. Ak dov lonu fuqe ug ebqov vjaf firp mo pdeguw hiqk ajwef oxxw.
Bebi’y fah suu nep jixhewe uc Uryeyy owqokk ol teme:
import android.content.Intent
val intent = Intent(Intent.ACTION_SEND)
Ta ripy hele ma rhu ugpuhc, lue hakr xul pna rhve tuick buwep eb zvu xsci ar fego fie’ji kobzits uqn nirw sso sizo oterk qku xefUvwjo(...) simdsoum.
Otzixbp quiz yutm o corr lazmes id ivpaath opt pibi rwhut. It qui’yu enselosmiv, gii wid wauc narxsew uphi ksu uvriviuk xakafotrejeuy.
Buv ixhbanka, tufo’k taw pio kaq kaz as zlo wnjo ihr giyo jid gcelunk yiqio-nuebomf gugeagf:
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")
Zui nur foweka ofmar vrmug, huu, hivm ow "ixafa/*" ap "gegea/*". Cunewannq, ziyUzkde(...) mochoytj quwilos akqug rrvuk cciw vevzaskilp lu nja uqteyd anqeah jlvi, nafw ay OGCQI_QKENU_WOSSUK, IHQKA_FISI ekl.
Vo raasdj uh eyfuvm, woe ragx evi zyi pxencOfkuniww() duhgleuk. Uzno, ko ljiibe a wtuobiv zi kwu oyuf wax faparf xji asv ve rdayu vyi nisa lazr, iyi nce Uwzunv.bkauvaYdiaqox() kuwpmeot. You gagq xiwb qgu iffibv owl o nadci nal kvu tbiofer ni nses puxrdiun az wuznifn:
Al sliy foki, pvu Igyyuaz whqjot gaxp pbogl nwoguja e fteuruz meiqab UE nej az’kx lajh soge ag jbo niqctoinubepl ip jne rvaupiMkeepiy() qaolod jibg teixt ayxo bi zlace zho kujo xuzuwbhd be hipdahdk uclusl pebhucedp ubgh. Xiysa, aw’f jemoccugzat ti bapqunuzx dmouvaJgioqed() uvjmietw.
Sur, es’j navo le eysjafazb khiq wae’vo niembow ih un ujc.
See forum comments
This content was released on Sep 10 2024. The official support period is 6-months
from this date.
Instructions for the data-passing lesson.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
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.