title: Get all Registered Email Accounts in Android
body: <p>I basically want to give option to user to select the email ID user wants. I don't want the contacts permission from user. Though account permission is fine with user. I tried <a href="https://stackoverflow.com/questions/2112965/how-to-get-the-android-devices-primary-e-mail-address">answer at stackoverflow</a> but it is not working for me. Is there any other way of getting it?</p>
  
  <p>What I have tried:</p>
  
  <p>Add this permission to manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  </code></pre>
  
  <p>And then request the google accounts like this:</p>
  
  <pre><code>Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
  for (Account account : accounts) {
      Log.d(TAG, "Found: " + account.name);
  }
  </code></pre>