Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

autoLink="all" feature of TextView Android

I am using the autoLink="All" feature of TextView to linkify all urls and telephone numbers in a TextView.

The problem I am facing is that on emulator, certain numbers are identified as phone numbers and are clickable. On real device, these numbers doesnt get identified as phone numbers and are not clickable.

Say If the TextView contains a number 163111, On emulator it is clickable. Clickng this takes user to dialer. But on Nexus 7 this number is not clickable. I had a look at the Linkify.addLinks() method, which I thought would explain this behaviour, but failed to find an explanation.

Has any one faced this problem?

What may be the reason behind this?

like image 212
Rahul Avatar asked Oct 14 '13 06:10

Rahul


2 Answers

try "autolink" property for textview.

android:autoLink="email|phone|web"

enter image description here

like image 146
KDeogharkar Avatar answered Oct 28 '22 22:10

KDeogharkar


Never mind. The emulator was running on 4.2 and Nex 7 was on 4.3

https://android.googlesource.com/platform/frameworks/base/+/430fc97

The modifications in Linkify code was the reason.

like image 27
Rahul Avatar answered Oct 28 '22 20:10

Rahul