Android : How to display my app when phone number is tapped (Open With)

Viewed 138

When a user taps on mobile number then open with bottom sheet pops up and asks the user to choose the app.

How can i show my app in that list? What permission do I need to add in my app for that?

1 Answers

You will just need a few lines in your Manifest:

<activity android:name=".MainActivity">
  <intent-filter>
    <action android:name="android.intent.action.MAIN"/>

    <category android:name="android.intent.category.LAUNCHER"/>
  </intent-filter>

  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <action android:name="android.intent.action.DIAL"/>

    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>

    <data android:scheme="tel"/>
  </intent-filter>
  <intent-filter>
    <action android:name="android.intent.action.DIAL"/>

    <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter>

</activity>

More info here : https://medium.com/makingtuenti/android-default-dialer-replacement-part-i-722d05ca50fe

Related