开发者

problem with linkify in android app

开发者 https://www.devze.com 2023-04-07 09:49 出处:网络
I have a phone number in a text view (thats the only thing I have there). I am using : Linkify.addLinks(textView, Linkify.ALL);

I have a phone number in a text view (thats the only thing I have there). I am using :

Linkify.addLinks(textView, Linkify.ALL);

However, the phone number is not being recognized by linkify. The number is of the format: (123) 456-7890. I have also tried 1234567890 and 123.456开发者_开发问答.7890. Nothing works. Any help ?

thanks.


In your XML file of your Text View add an attribute android:phoneNumber="true"

Try this in the Click of the Text View :

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("tel:"
                + your_phone_number)));

Automatically the Text will have the property of Phone number.


Since you are trying something that is custom refer to this doc

http://developer.android.com/resources/articles/wikinotes-linkify.html

it will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号