---
title: "Describe Intents in detail"  
description: "Describe Intents in detail"  
author: "Anonymous User"  
published: 2015-05-28  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/2590/describe-intents-in-detail  
category: "android"  
tags: ["android", "android intent"]  
reading_time: 3 minutes  

---

# Describe Intents in detail

An Android application can contain zero or more activities. If you want to navigate fromone activity to another then android provides you Intent class. This class is available inandroid.content.Intent package.One of the most common uses for Intents is to start new activities.

There are two types of Intents.

Explicit Intents

Implicit Intents

**Intents works in pairs:** actionand data. The action defines what you want to do, such as editing an item, viewingthe content of an item etc. The dataspecifies what is affected,such as a person in the Contacts database. The data is specified as anUri object.

**Explicitly starting an Activity**

```
Intent intent = newIntent (this, SecondActivity.class);startActivity(intent);
```

Here SecondActivity is the name of the target activity that you want to start.

\
**Implicitly starting an Activity**

If you want to view a web page with the specified URL then you can use this

procedure.

```
Intent i = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(“http://www.amazon.com”));startActivity(i);
```

if you want to dial a telephone number then you can use this method by passing

the telephone number in the data portion

```
Intent i = new Intent (android.content.Intent.ACTION_DIAL,Uri.parse(“tel:+9923.....”));startActivity(i);
```

In the above method the user must press the dial button to dial the number. If you want to directly call the number without user intervention, change the action as follows:

```
Intent i = newIntent (android.content.Intent.ACTION_CALL,Uri.parse(“tel:+9923.....”));startActivity(i);
```

If you want to dial tel no or use internet then write these line in AndroidManifest.xml

```
<uses-permissionandroid:name=”android.permission.CALL_PHONE”/><uses-permissionandroid:name=”android.permission.INTERNET”/>
```

## Answers

### Answer by Anonymous User

An Android application can contain zero or more activities. If you want to navigate fromone activity to another then android provides you Intent class. This class is available inandroid.content.Intent package.One of the most common uses for Intents is to start new activities.

There are two types of Intents.

Explicit Intents

Implicit Intents

**Intents works in pairs:** actionand data. The action defines what you want to do, such as editing an item, viewingthe content of an item etc. The dataspecifies what is affected,such as a person in the Contacts database. The data is specified as anUri object.

**Explicitly starting an Activity**

```
Intent intent = newIntent (this, SecondActivity.class);startActivity(intent);
```

Here SecondActivity is the name of the target activity that you want to start.

\
**Implicitly starting an Activity**

If you want to view a web page with the specified URL then you can use this

procedure.

```
Intent i = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(“http://www.amazon.com”));startActivity(i);
```

if you want to dial a telephone number then you can use this method by passing

the telephone number in the data portion

```
Intent i = new Intent (android.content.Intent.ACTION_DIAL,Uri.parse(“tel:+9923.....”));startActivity(i);
```

In the above method the user must press the dial button to dial the number. If you want to directly call the number without user intervention, change the action as follows:

```
Intent i = newIntent (android.content.Intent.ACTION_CALL,Uri.parse(“tel:+9923.....”));startActivity(i);
```

If you want to dial tel no or use internet then write these line in AndroidManifest.xml

```
<uses-permissionandroid:name=”android.permission.CALL_PHONE”/><uses-permissionandroid:name=”android.permission.INTERNET”/>
```


---

Original Source: https://www.mindstick.com/interview/2590/describe-intents-in-detail

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
