Step 1: first in the main. build the dialing interface in the XML file (we recommend that you use a tool to drag it, because it is faster and you do not need to define something in other files) Main. XML <textview Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: text = "@ string/tipmsg"/> <edittext Android: id = "@ + ID/phone" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: inputtype = "phone"> <requestfocus/> </edittext> <button Android: Id = "@ + ID/callbtn" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "@ string/num"/> Step 2: strings under values. XML file <string name = "app_name"> phone </string> <string name = "tipmsg"> enter the correct phone number </string> <string name = "num"> dialing </string> Step 3: in phoneactivity. configure public class phoneactivity extends activity {@ override public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); // sets the displayed view setcontentview (R. layout. main); // obtain the current view component button callbtn = (button) findviewbyid (R. id. callbtn); callbtn. setonclicklistener (New onclicklistener () {@ overridepublic void onclick (view v) {// edittext phone = (edittext) findviewbyid (R. id. phone); // What is the intention? // obtain the phone in the text box. gettext (); intent = new intent (intent. action_call, Uri. parse ("Tel:" + phone. gettext (); // starts processing the intent to execute phoneactivity. this. startactivity (intent) ;}}) ;}} Step 4: In androidmanifest. add the dialing permission to the XML file (we recommend that you add the permission on the Visual Interface): Open androidmanifest. XML file, click Permissions ---> click Add to add users permission --> select Android In the Name box. permission. call_phone --> Step 5: Right-click to run