Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i want to write a program that makes calls directly .
this is my code :

Java
Intent i=new Intent(android.content.Intent.ACTION_CALL,Uri.parse("tel:09126104851"));
        startActivity(i);

but it doesn't work !
i think it needs permission .
how can i set this permission ?
Posted
Updated 14-Mar-18 22:56pm

1 solution

Add these permissions in AndroidManifest.xml inside manifest tag
XML
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900