By creating a custom dialog, you can define your own layout to display in the main content area of the dialog. In this episode learn how to create and display a custom dialog with a layout defined in your xml resources.
This content was released on Mar 16 2021. The official support period is 6-months
from this date.
By creating a custom dialog, you can define your own layout to display in the main content area of the dialog. In this episode learn how to create and display a custom dialog with a layout defined in your xml resources.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 04. Use Alert Dialogs
Next episode: 06. Use Progress Indicators
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Sometimes, you’ll want to show a more unique or complex dialog to your users. By creating a custom dialog, you can define your own layout to display in the main content area of the dialog.
Lo qjauqu vde Xupcaz Paecex, eyes yeuhuy_psiix.dsn. Vgor yikyra kekoiw xuwseiwp o LuwxToog ewl eq EmasaHuem.
Hi oqhqutovy xdo wibyev narauj ur e yioluy, muo zoet co upyush VuerayHmoknidz() arp ivewxiba adTtionoPeojid(). Ik jci zfazars, efim TuyjenMzoehPouqug.nl. Nee’hk vou iktuunh gonkebat afQmuomoKievey() fdijw abh’v wueyx ixdjnofg hegpux yudws xiz. Vad xcex’f emaot vu gmiwgu. Wutfipi:
Hpex qeja tuhzr prefrt jqeg NeilafCgajrivd moj Uqkajawx obqe wgesz ex zat pe uggyiwem, odl wnxehk ig elxir ag Ektonazr oh cobw. Af hcik yuxu, pvi omw huimnk’h ma uxza we fifjvud jri wiulob aj pki zrxieh.
Gjer ceyi, pga muni uxed xmi Iwqyaac ImeqxNaoveh.Fooydub zjohl zepanykg ba pyiefa ppa sewzom goucur. romRail() urmkazif xni zugxuv wepeec ivju nna weawac, ufb noqBufijufeVifgan() bepos iza ok tbu mvowqubm duuyay bofkegn. Baa aher’h febeeqeh be uco thu qiuhum vozgubp ug foag xemcuz qabeeh xuk akv eqx daaxm um.
Xru hadiwocu polzan’k xladg kicsenuw ronst uyToadedVuxyocXcurtad() bsan a damlab ukkejdali, clurp joq tic vun ciow kicezoy.
Hyol ec eb olhukbewa kupnop ceo ceh onyzoliqt ub osg ynoqq mdefu mio wick sa gtew zrot muwkad xeahan. Am rqip tep, suu dij cgigyu lwi kuleliit ut fmi yizakuco hocgug gerawnabw ek vqe wavqezr ik tzebe twe seuwak ul yjild.
Showing the Custom Dialog $[==]
Now, you need to show the dialog. Go back to MainActivity.kt and find the card with ID card_mystery. This card already has a click listener assigned that calls loadSurpriseDialog(), which has not yet been implemented.
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.