0
我通过editText从用户获取数字,并设置为TextView成功。我如何实现呼叫意向:我的电话意图错误实施?
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.template);
final TextView crdMobile = (TextView) findViewById(R.id.crdMobile);
crdMobile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:+"+crdMobile.getText().toString().trim()));
//callIntent.setData(Uri.parse(crdMobile.getText().toString().trim()));
startActivity(callIntent);
}
});
当我点击crdMobile,设备上出现正常的通话界面。但没有呼叫正在完成。几秒钟后,通话结束,不拨号。你能帮我怎么改善或纠正吗?谢谢。
使用ACTION_DIAL要求用户再按一次点击,但我认为它很有用。谢谢。 – Umitk