Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numbers in string to be callable

I am working on my Android app, and I saved some text that containts data, phone numbers and e-mail adresses in my strings.xml file and I display that text in my TextView. Is it possible to make when someone click on phone number to call that number ? I wanna make same with e-mail adresses...

like image 503
Mahir Duraković Avatar asked Aug 20 '13 18:08

Mahir Duraković


1 Answers

Use this line in you textView Xml for phone

    android:autoLink="phone" 
    android:linksClickable="true"

and this for email:

   android:autoLink="email" 
   android:linksClickable="true"

EDIT

If you want to check for email, phone number and url use these lines:

    android:autoLink="web|email|phone"
    android:linksClickable="true"
like image 190
Eric B. Avatar answered Nov 08 '22 08:11

Eric B.