How to make a phone call using intent in Android?
Every thing is fine.
i just placed call permissions tag before application tag in manifest file
and now every thing is working fine.
phone call using intent in android
You can open up the dialer with a phone number already typed in it -
Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + "0" + getItem(pos).getMobile()));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
But for you to be able to call a phone directly from a button click or something, you will need to add the permission, because if you're doing so, it means that your app is making the call, for which it needs permission from the android operating system.
How to make a phone call programmatically?
You forgot to call startActivity. It should look like this:
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + bundle.getString("mobilePhone")));
context.startActivity(intent);
An intent by itself is simply an object that describes something. It doesn't do anything.
Don't forget to add the relevant permission to your manifest:
<uses-permission android:name="android.permission.CALL_PHONE" />
Android Intent call number
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.
How to intent dialer call from service?
"SOMENUMBER".toUri()
should be
"tel:SOMENUMBER".toUri()
https://developer.android.com/reference/android/content/Intent.html#ACTION_CALL
Input: If nothing, an empty dialer is started; else getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.
Other related questions:
Call intent in Android
Android Intent.ACTION_CALL, Uri
Related Topics
Playing an Arbitrary Tone With Android
Android Youtube App Play Video Intent
Viewpager.Setoffscreenpagelimit(0) Doesn't Work as Expected
Show Compose Sms View in Android
Android: How to Validate Edittext Input
Using Zxing to Create an Android Barcode Scanning App
Lock the Android Device Programmatically
Show Image View from File Path
How to Check If My Edittext Fields Are Empty
Runtimeexception: Your Content Must Have a Listview Whose Id Attribute Is 'Android.R.Id.List'
How to Add Manifest Permission to an Application
How to Change Position of Toast in Android
How to Make Ellipsize="Marquee" Always Scroll
Why Does Android Webview Sporadically Not Sending My Session Cookie