0

I use this function for account chose and pick get user's email.

    private void pickUserAccount() {

        String[] accountTypes = new String[]{"com.google"}; 

        try { // request account

            Intent intent = AccountPicker
                    .newChooseAccountIntent(null, null, accountTypes, false, null, null, null, null);

            startActivityForResult(intent, AuthProcess.REQUEST_CODE_PICK_ACCOUNT);

/*
        Error control

*/

        } catch (CriticalException e) {

            throw e;

        } catch (OutOfMemoryError e) { // problems with memory    

            throw e;

        } catch (Throwable e) { // Other exceptions

            final String message = "Error during google account picker dialog: " + e;

            throw new CriticalException(logcat, message);

        } 

    } // End: pickUserAccount

In android 6.0 this code open dialog for chose account in spite of only one google account present at the device. In android 4.4.2 it work nice. What's the problem? Thank you.

Yury Finchenko
  • 1,035
  • 13
  • 19
  • Anything useful in the Logcat? – Sufian Feb 28 '16 at 16:09
  • utility library provided html debug output, device file logging, text operations etc – Yury Finchenko Feb 29 '16 at 15:55
  • I can't understand what you mean. Can you update your question with the Logcat? – Sufian Feb 29 '16 at 17:55
  • This code open dialog: https://drive.google.com/file/d/0B9H-yfu0v-2AX2NNdDRvMzc4Q2s/view The only one google account present at the device. In android 4.4.2 I recive user e-mail at once (only one google account mean than only one e-mail can be received - no need to open account choose dialog) – Yury Finchenko Mar 01 '16 at 08:56

0 Answers0