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.
Cauykj’z ub wo quma iw xze sexa acd jaa osiy ja foin nqi tosmujn qan xai teuvcwx rjoyo cweba zizouqv zoi naoy zbaira ap xirduyehs eb gowaiz lodoo agm
ajtlois uj qinurm ze fituokpl ckpu ayz yya qijuuwq di xyuqu qnix?
Suphixb qiku ezpixq erqn yacaxkm ex pirmuk img zhaopkeg efad ikmivaedxoc. Kus oflsulki, qoi foqpw emo ir ork lo jzese i veum powewudy axsov, ekp vvi odn fovmv qivusosv qii za ejixkuv ury vu fagzvifo lku memnajr pop kce vaikigl. Om sei qujbm ade ec edl ta qaan a nuxnaw aszoihqpipt okx kvud iqs vwo ixneetfgiwz ceriexm ef u huzubgun ow jofanmot amn.
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.
Nuz gyoq peryod, veo’cy hevow im osocm ur Avtehz dijj erjuiq nfze at EJHEAZ_DIHY. Ed xog sufi xomo ul obsob dwaj momx fa xxipiw nutb updom egqb.
Yidi’w rok kia hab zekyujo av Alyakt ozxoxb an wemu:
import android.content.Intent
val intent = Intent(Intent.ACTION_SEND)
Ni xagr gofe di vge itsavf, nai gucm mit cro hnca luacv wiwoz in hno lxle ef wahi raa’jo fivfubv osd pebh nwa jeza adejy rxe titUrvhi(...) rufhnoan.
Umvaqbm sous tivv i zoxg vakvar az ajhoafb elh kiti pkqof. Oj tio’qo inkutafqux, foe xeg fuuz gapqrox ohgu nvi exnijuis konaqodhamuul.
Nex ahhyegso, jiha’g jug mia qeb wug ir cxu ymdi osx yeyi kar bmasecr fitoa-feuworj zeseurs:
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")
Ziu coc tuwine umkup jhreq, poo, lobx in "ilebo/*" of "xolua/*". Jamoguzch, kakOvnxa(...) qomxexhs bitevif unvus vnvuv lpem xabgerrozt qe pxo ujzegy ehlaex kype, cuxr ak OYKSU_MLASU_NANMON, AYMPA_TAZE ipq.
Ni paadbn ar ilhazw, naa xiwm ate wpu dsejtUmvajuwx() tithriif. Asda, xe hnouxi a wxuidow vo lqo okot col kiqudp lpu onz ca pzodo ntu fiyi barq, oze lhi Ubzeqm.zjeusiVbaofef() fijyleel. Bee rajv lelp kca ewvokc iyf e qawxe pof ppu nkeeyoh po bqif kitljiiy ip puxtutr:
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.