O'Reilly logo

Android Development Tools for Eclipse by Sanjay Shah, Khirulnizam Abd Rahman

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

Intent and Activity

Intent is an abstract description of an operation to be performed. To be more specific, it is an asynchronous call which allows the application to request functionality from other Android components, for example, services/activities. It can be used with the startActivity() command to launch an activity. The previous code in SimpleNumb3r5.java is the main activity (or class) for this application. We've just created the second activity (class) in the file Info.java. In order for the second activity to appear, it has to be started using an intent.

We have decided to use the button btninfo as the trigger to invoke the second activity. Again, open the file SimpleNumb3r5.java and add the following lines to invoke another activity. ...

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