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

Resolving an Implicit Intent

NerdLauncher will show the user a list of apps on the device. To do so, it will send an implicit intent that every application’s main activity will respond to. The intent will include a MAIN action and a LAUNCHER category. You have seen this intent filter in your projects:

 ​ ​<​i​n​t​e​n​t​-​f​i​l​t​e​r​>​
 ​ ​ ​ ​<​a​c​t​i​o​n​ ​a​n​d​r​o​i​d​:​n​a​m​e​=​"​a​n​d​r​o​i​d​.​i​n​t​e​n​t​.​a​c​t​i​o​n​.​M​A​I​N​"​ ​/​>​
 ​ ​ ​ ​<​c​a​t​e​g​o​r​y​ ​a​n​d​r​o​i​d​:​n​a​m​e​=​"​a​n​d​r​o​i​d​.​i​n​t​e​n​t​.​c​a​t​e​g​o​r​y​.​L​A​U​N​C​H​E​R​"​ ​/​>​
 ​ ​<​/​i​n​t​e​n​t​-​f​i​l​t​e​r​>​

In NerdLauncherFragment.java, override onCreate(Bundle) to create an implicit intent. Then get a list of activities that match the intent ...

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