标签:android blog java os art io
public class CallActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) this.findViewById(R.id.button1); button.setOnClickListener(new ButtonOnClickListener()); } private final class ButtonOnClickListener implements View.OnClickListener{ @Override public void onClick(View v) { EditText mobileText = (EditText) findViewById(R.id.moblie); String number = mobileText.getText().toString(); Intent intent = new Intent(); intent.setAction("android.intent.action.CALL"); intent.addCategory("android.intent.category.DEFAULT"); intent.setData(Uri.parse("tel:" + number)); startActivity(intent); //注册android.intent.category.DEFAULT } } }
标签:android blog java os art io
原文地址:http://www.cnblogs.com/docomo/p/3850355.html