Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Intent call number [duplicate]

Tags:

I have my phone number at TextView and want to open "Intent-picker" to choose application that I want to call with(Skype, Viber...) or just dial to call it.

Intent callIntent = new Intent(Intent.ACTION_CALL); calls instantly so it doesn't help me.

like image 852
Kyryl Zotov Avatar asked Jan 04 '16 17:01

Kyryl Zotov


People also ask

How is intent used to dial numbers?

In the MainActivity Intent, the object is created to redirect activity to the call manager, and the action attribute of intent is set as ACTION_CALL. Phone number input by the user is parsed through Uri and that is passed as data in the Intent object which is then used to call that phone number .

What is used of intent Action_call?

Intent Object - Action to make Phone Call Intent phoneIntent = new Intent(Intent. ACTION_CALL); You can use ACTION_DIAL action instead of ACTION_CALL, in that case you will have option to modify hardcoded phone number before making a call instead of making a direct call.

How can make call in android programmatically?

Method 1) Dial a number (Permission-free) parse() function. Step 2: Set the Intent Action of Intent to Intent. ACTION_DIAL such that Android system can filter and delegate the dialling action to any app that can make a phone call.


1 Answers

I think you are looking for something like this:

Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:0123456789")); startActivity(intent);  

This opens the dialer (or creates a chooser dialog if there are multiple apps installed which can place a phone call) with the number filled in, but does not actually start the call. See this answer for more info.

like image 110
JonasCz Avatar answered Oct 31 '22 19:10

JonasCz