From the course: Android Development Essential Training: App Architecture with Kotlin
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Display a Share button on the toolbar - Android Tutorial
From the course: Android Development Essential Training: App Architecture with Kotlin
Display a Share button on the toolbar
with each other on the same device, using a system known as implicit intents. Before you can add an implicit intent to an application, though, you need to add some sort of user interface that the user can use to trigger the share operation. I'm going to create a new icon in my application. I'll right-click on my app module and select new, vector asset, and I'll set the asset type to clip art, and in the clip art menu you can search for share, and choose the share icon. I'll change the name of the file I'm creating to ic_share, and this will actually be an xml file, and if your color is showing up as black you can click there and just drag the slider all the way to the top, and then click choose, and that'll create a white icon. Follow the rest of the prompts to create the file. The file will be dropped into your drawable directory, its name is ic_share.xml, and if you don't see this preview window you can open it by selecting view, tool windows, preview. And that'll show you what the…