6

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?

Rahul
  • 1,169
  • 1
  • 12
  • 27
  • What you are getting when click on numbers on Nexus 7 ? – Hardik Joshi Oct 14 '13 at 08:19
  • 1
    In nexus 7 the number 163111 isnt clickable(it is clickable and identified as phone number in emulator). That is linkify doesnt identifies it as phone number. But numbers like +14132213333 is identified as phone number in both emulator and Nexus 7. – Rahul Oct 14 '13 at 08:35
  • What exactly was the solution in the end. I'm having the same issue. Can you please paste some code – Amanni Jul 09 '15 at 20:04
  • We didnt fix it at the end.. 'works as designed' :D .. in 4.3, they have changed some Linkify behaviour.. my device was runing 4.3 and emulator i used was that of 4.2 – Rahul Jul 13 '15 at 11:07

2 Answers2

4

try "autolink" property for textview.

android:autoLink="email|phone|web"

enter image description here

KDeogharkar
  • 10,939
  • 7
  • 51
  • 95
2

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.

Rahul
  • 1,169
  • 1
  • 12
  • 27