title: How to show&handle contact details intents of apps?
body: <h2>Background</h2>
  
  <p>Not sure how it's called, but when you open the contact-details screen of the contacts app, you see various apps there that you can click to perform actions on (such as calling and sending messages via Viber and WhatsApp) as such:</p>
  
  <p><a href="https://i.stack.imgur.com/GwYwL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GwYwL.png" alt="enter image description here"></a></p>
  
  <h2>The problem</h2>
  
  <p>I don't know how those actions are called, so I can't find out how to investigate them. I tried searching for each social network, how to use it, but this seems like a lot of effort that might not even work well in the future.</p>
  
  <p>I wish to query those actions, show them, and handle them, for all of the apps that are shown on the native contacts app.</p>
  
  <h2>What I've tried</h2>
  
  <p>I tried to investigate the intents that are being used, and found that for Viber, this is what can be used for messages:</p>
  
  <pre><code>    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://com.android.contacts/data/"+id));
      intent.setPackage("com.viber.voip");
  </code></pre>
  
  <p>However, I don't know what this "id" is, only that it works because I've tested it with real data. I also tried to actually print all of the contacts database, to find the correct value to use (and the mapping), but I didn't find it.</p>
  
  <p>Also, I can't find how this information should have been found. My guess is that it should probably include a query of the available mimetypes, and check them on the specified contact (probably using contact id).</p>
  
  <h2>The question</h2>
  
  <p>Given a contact (id or phone number), how can I show and perform the operation as shown on contact-details screen of the contacts app ?</p>