Make a phone number callable in Android

by Dr. Osama M. Khaled last modified 2022-07-19T05:23:42+01:00
You may want to present a number and make it callable.

 I tried different ways using different tags in android TextView, but what worked for me correctly is to put the number in a WebView and make it as a link with tel: prefix in href

Here is a simple method that takes a number and wrap it in a link tag to send it to WebView after that

public static String wrapAsCallablePhone(String number) {
return "<a href=\"tel:" + number + "\">" + number + "</a>";