Книга: Beginning Android
Make an Intent
Make an Intent
As discussed in Chapter 1, Intent
s encapsulate a request, made to Android, for some activity or other Intent
receiver to do something.
If the activity you intend to launch is one of your own, you may find it simplest to create an explicit Intent
, naming the component you wish to launch. For example, from within your activity, you could create an Intent
like this:
new Intent(this, HelpActivity.class);
This would stipulate that you wanted to launch the HelpActivity
. This activity would need to be named in your AndroidManifest.xml
file, though not necessarily with any Intent
filter, since you are trying to request it directly.
Or you could put together an Intent
for some Uri
, requesting a particular action:
Uri uri = Uri.parse("geo:" + lat.toString() + "," + lon.toString());
Intent i = new Intent(Intent.ACTION_VIEW, uri);
Here, given that we have the latitude and longitude of some position (lat
and lon
, respectively) of type Double
, we construct a geo
scheme Uri
and create an Intent
requesting to view this Uri(ACTION_VIEW)
.
- Make the Call
- Pieces of Intents
- Intent Routing
- You Make the Call!
- 4.3.3. Makefile Targets
- Scaling makes your object darker?
- 1.3. Автоматизация процесса с помощью GNU-утилиты make
- 15.4. Утилита make: автоматизация процедур
- Команда make и make-файлы
- 5.1.1 Make Targets
- The Master Algorithm: How the Quest for the Ultimate Learning Machine Will Remake Our World
- Модуль RobotTaskMaker