Reputation: 655
So I have this TextView field and it has a number in it
<TextView android:phoneNumber="true" android:textSize="14sp" android:textColor="#283486" android:layout_width="300dip" android:id="@+id/Contact" android:gravity="bottom" android:layout_height="wrap_content" android:text="@string/phoneNumber"></TextView>
I want it so that when they touch this number it takes them to the number dialer on their phone so that they can call that number.
How would I go about that
Upvotes: 1
Views: 1761
Reputation: 64700
Try to add the android:autoLink
attribute:
<TextView android:autoLink="phone"
android:phoneNumber="true"
android:textSize="14sp"
android:textColor="#283486"
android:layout_width="300dp"
android:id="@+id/Contact"
android:gravity="bottom"
android:layout_height="wrap_content"
android:text="@string/phoneNumber">
</TextView>
Upvotes: 3