Android Intent.ACTION_CALL, Uri -


i trying use intent.action class. know how use action_view display url wanted use intent.action_dial call number when application launched. documentation says need parse uri string , add intent tried this:

uri call = uri.parse("7777777777");              intent surf = new intent(intent.action_dial, call);  startactivity(surf); 

this doesn't work error message saying:

unfortunately, project has stopped. tried debug code , seems point me intent line not sure doing wrong if works , brings dialer.

//uri call = uri.parse("7777777777");                intent surf = new intent(intent.action_dial);    startactivity(surf); 

tel

string number = "23454568678";     intent intent = new intent(intent.action_call);     intent.setdata(uri.parse("tel:" +number));     startactivity(intent); 

use permission

<uses-permission android:name="android.permission.call_phone"></uses-permission>    

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -