Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>once the user selects particular mail client,I need to show his inbox</p> </blockquote> <p>There is no standard <code>Intent</code> structure for showing an email inbox. There are many, many email apps for Android, each of which can do this however they wish.</p> <p>The best you can hope to do is:</p> <ul> <li><p>Create an <code>ACTION_SENDTO</code> <code>Intent</code> with a <code>mailto:</code> <code>Uri</code></p></li> <li><p>Use that <code>Intent</code> with <code>PackageManager</code> and <code>queryIntentActivities()</code> to find all activities that support this, and hope that they are actually from email clients</p></li> <li><p>Find out the applications associated with those activities, from the <code>ResolveInfo</code> you get back from <code>queryIntentActivities()</code></p></li> <li><p>Use <code>getLaunchIntentForPackage()</code> on <code>PackageManager</code> to find some likely "front door" activity for each of the applications</p></li> <li><p>Create your own chooser-style dialog to allow the user to choose one of those applications</p></li> <li><p>Call <code>startActivity()</code> on the <code>Intent</code> they chose</p></li> </ul> <p>However:</p> <ul> <li><p>This may include non-email apps, as I am welcome to write an app that offers to support <code>mailto:</code> <code>Uri</code> values with <code>ACTION_SENDTO</code></p></li> <li><p>The "front door" activities of these apps are not necessarily the inbox</p></li> </ul> <blockquote> <p>he can select the particular email and he can send that email</p> </blockquote> <p>I have no idea what this means.</p> <blockquote> <p>To open email clients i have used this particular code</p> </blockquote> <p>Note that your code has two flaws:</p> <ol> <li><p>You are using an invalid MIME type (plain text is <code>text/plain</code>, not <code>plain/text</code>)</p></li> <li><p>You are not supplying a prompt for the chooser</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload