=+Usually, you use the setData() method to set the data on which an Intent object is going

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 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();

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Beginning Android Programming With Android Studio

ISBN: 9781118707425

4th Edition

Authors: Wei Meng Lee, Jerome F DiMarzio

Question Posted: