O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Implicit Intents

An Intent is an object that describes to the OS something that you want it to do. With the explicit intents that you have created thus far, you explicitly name the activity that you want the OS to start.

I​n​t​e​n​t​ ​i​ ​=​ ​n​e​w​ ​I​n​t​e​n​t​(​g​e​t​A​c​t​i​v​i​t​y​(​)​,​ ​C​r​i​m​e​C​a​m​e​r​a​A​c​t​i​v​i​t​y​.​c​l​a​s​s​)​;​
s​t​a​r​t​A​c​t​i​v​i​t​y​(​i​)​;​

With an implicit intent, you describe to the OS the job that you want done. The OS then starts the activity that has advertised itself as capable of doing that job. If the OS finds more than one capable activity, then the user is offered a choice.

Parts of an implicit intent

Here are the critical parts of an intent that you can use to define the job you want ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required