You can send complex information in an intent with the data property (a URI) or with intent extras. Each extra is a key-value pair, and you can pass as many extra values as you need. Learn how to send complex data from one activity to another using both data and extra values.
- [Instructor] When you start a new activity with an Intent,…you can pass an action as I showed previously,…but you can also pass much more detailed data.…There are a couple of ways of doing this…using either the data object of the Intent…or you can pass data extras.…The URI is a single property and it's a strongly typed…uniform resource identifier object.…Here's how you create it.…I'll place this code before I call startActivity…in the MainActivity class.…
And I'll create a new object that I'll call uri.…And I'll use the Java URI class from Android.net.…From there, I'll call the parse function…and I'll pass in the string.…Typically, this is a string that looks like a URL,…so you start with http://…and then add your base package.…And for me, that's com.example.myfirstapp.…Next, you can add one or more virtual directory names…and these will constitute the action that you want to pass.…
I'll use view.…And then you can add a query string.…I'll put in a question mark and say, id=…and then I'll pass in the monsterId variable.…
- Installing Android Studio
- Creating your first Android Studio project
- Managing configuration files, including Gradle scripts
- Defining screens with activities
- Implementing designs in XML layouts
Skill Level Beginner
Android P First Look for Developerswith David Gassner36m 30s Beginner
Android Studio Essential Trainingwith David Gassner2h 28m Beginner
What you should know2m 10s
1. Android Development Fundamentals
2. Getting Started
3. Explore Android Projects
4. Android App Architecture
Next steps1m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.