Package com. eboy. Phone;
Import android.net. Uri;
Import Android. OS. Bundle;
Import Android. App. activity;
Import Android. content. intent;
Import Android. View. view;
Import Android. widget. Button;
Import Android. widget. edittext;
Public class mainactivity extends activity {
Private edittext text = NULL;
Private button btn1 = NULL;
@ Override
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Setcontentview (R. layout. activity_main );
Btn1 = (button) findviewbyid (R. Id. Button );
TEXT = (edittext) findviewbyid (R. Id. edittext );
Btn1.setonclicklistener (New buttonclicklistener ());
}
Private final class buttonclicklistener implements view. onclicklistener {
Public void onclick (view v ){
String number = text. gettext (). tostring ();
Intent intent = new intent ();
Intent. setaction ("android. Intent. Action. Call ");
Intent. setdata (URI. parse ("Tel:" + number ));
Startactivity (intent); // The method automatically adds category: Android. Intent. Category. Default to intent.
}
}
}
/Files/jxgxy/phone.rar