How to get phone number from number clicked (on other app) and display it in my own app

179 views Asked by At

I make an app that like android dialer. I need to show my app on "open with" list when someone click on number on android (like default dialer or get contact), and how to get the number clicked and put it on textview on my app..?

Im sorry if there was a same question, but i tried to find the sollution then still nothing.

1

There are 1 answers

0
Miguel On

I know it's a bit late to answer, but, in case somebody else is looking for the short answer, this code worked for me:

Intent intent = getIntent();
Uri returnUri = intent.getData();
String phoneNumber = returnUri.toString().replace("%20", "").replace("tel:","");
Log.i("PHONE_NUMBER",  phoneNumber);