In Android, an Intent is a message which allows you to request functionality from other Android components, whether those components are from the same application or from a different one. An intent can be used for instance to open an activity from the same app or to open an activity from another app.
SongExplorerForAll v7
In SongExplorerForAll v6, we created an about menu in the action bar. Here, clicking on the about menu displays a dialog which gives information about the app.
When creating an intent, we have to specify the type of action to perform. Here, we use ACTION_VIEW which is basically used when we need to display data to the user.
SongExplorerForAll v8
Another type of action is ACTION_SEND. This is used when we want the user to be able to share some data through another app. In SongExplorerForAll v8, when the user clicks on the share icon in the action bar, the latter will be able to share information about the Song Explorer For All app. The user is presented with a list of apps which can perform the sharing action (e.g. Gmail), from which he/she can choose.
There are two types of intents namely explicit intents and implicit intents. When using explicit intents, we have to explicitly specify the component to start by name. On the other side, when using implicit intents, we simply declare the action to perform. The Android system then finds appropriate component(s) to handle the intent. If there are several apps which can handle the intent, we can show a chooser dialog.
Leave a Reply