Question: =+Usually, you use the setData() method to set the data on which an Intent object is going to operate, such as passing a URL to

=+Usually, you use the setData() method to set the data on which an Intent object is going to operate, such as passing a URL to an Intent object so that it can invoke a web browser to view a web page.

(For more examples, see the section “Calling Built-In Applications Using Intents,” later in this chapter.)

To retrieve the data set using the setData() method, use the getData() method (in this example data is an Intent object):

//---get the result using getData()---

Toast.makeText(this, data.getData().toString(), Toast.LENGTH_SHORT).show();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Implementing Programming Languages Questions!