Overview Overview Search Search Up Up
Download details
Starting an Activity for result Starting an Activity for result

Start me up: Starting an activity to get a result

Sometimes, you may need to get data from another activity. That activity could be in your app or in another app.

You could use startActivityForResult() to get that data for you.

Here’s an example.

Let’s say your app needs to take a photo. All you need to do is send the instruction to the device’s camera app. It will take the photo and return it to your app. Using startActivityForResult() is an easy way of doing that.

You can see how we did it in our camera app tutorial.

In this tutorial, I’ll use a simple app to show you how to use startActivityForResult () to get data from another activity.

The tutorial app

We’ll use startActivityForResult() to request data from two activities that we start. One will return some data while the other activity will cancel the request.

Let’s have a look at how it’s done.

Read more...

Data

Version 1
Size 2.81 MB
Downloads 40
Language English
License GNU/GPL external
Author This email address is being protected from spambots. You need JavaScript enabled to view it.
Website Website external
Price Free
Created 2015-12-13
Created by Clive Sargeant
Changed 2016-01-04
Changed by Clive Sargeant

Only registered and logged in users can download this file.