Difference between revisions of "MAP524/DPS924 Lecture 8"

From CDOT Wiki
Jump to: navigation, search
(Created page with '= Content Providers = This week we're looking at another means of sharing data between Android apps, this one is usually used for well structured data with a stable API for acce…')
(No difference)

Revision as of 12:49, 2 August 2015

Content Providers

This week we're looking at another means of sharing data between Android apps, this one is usually used for well structured data with a stable API for accessing it. But first..

A look back at Intents

Most of you have only used an intent to start an activity, and haven't thought much about the Intent object. Today let's use a couple of features available with an intent, specifically for passing data to the activity being started and getting data back from it.

This tutorial is pretty good, it talks about how to use the Intent to pass data to and receive it in an Activity. Android Studio autocomplete will help you see what other types of data you can pass.

To get data back from an activity you started you need to use startActivityForResult() instead of startActivity(), see here for an explanation and example.