就号码点击呼叫 [英] Make call on number click
问题描述
我需要一点点帮助。
我有,我的应用程序,其中包含一个电话号码一个TextView,我要拨打电话,当我点击电话号码。
我已经做到了这一点:
I need a little help. I have ,in my app, a textView which contains a phone number,and i want to make a call when i click that phone number. I've already accomplished that:
sitePhone.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
String number = "tel:" + sitePhone.getText().toString().trim();
Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(number));
startActivity(callIntent);
}
});
现在的问题是,有时我有我的文本视图2个或3个电话numbers.Something这样的:07456443345 FAR:0745456334。我从数据库中拿手机串号,因此它不能被改变。
如何我可以对每个号码点击呼叫任何的IDE?在此先感谢
Now the problem is that sometimes i have on my text view 2 or 3 phone numbers.Something like this: "07456443345 FAR: 0745456334".I take the phone number string from the database so it cannot be altered. Any ides of how i can make a call on each number click? thanks in advance
推荐答案
我发现了一个简单的答案:
的android:自动链接=手机
意愿的伎俩
i found a simple answer:
android:autoLink="phone"
will to the trick.
这篇关于就号码点击呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!