14

I have implemented a custom account for an app I'm working on. Here is my authenticator.xml:

<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="MyApp"
    android:icon="@drawable/logo"
    android:smallIcon="@drawable/logo"
    android:label="MyApp"
    android:accountPreferences="@xml/account_preferences" />

I can add the account using the Android setting's "Add Account" feature, and my app can use all the account's information. However the account doesn't ever show in the list with my Google, Twitter, Faceboock, etc. accounts.

Michael K
  • 3,297
  • 3
  • 25
  • 37

1 Answers1

38

I found a trail in a related question, where the questioner is trying not to show his custom account in Android settings. If you do not specify a label, the account won't show up in the list.

If you do not specify a localized string, the same thing happens. I fixed it by added an entry to strings.xml and changing:

android:label="MyApp"

to:

android:label="@string/app_name"

Now the account shows in "Accounts and Sync" section of settings.

Community
  • 1
  • 1
Michael K
  • 3,297
  • 3
  • 25
  • 37
  • 9
    arghh all the afternoon debugging oauth workflows ... and it was the @#!!! label... – rupps Apr 20 '14 at 15:34
  • If android:label is not specified, at least my device with Android 4.1.2 shows blank entry at top of Add Account list – Kuitsi Mar 21 '15 at 18:35
  • @Kuitsi yep, this is what OP says also - the issue is after the account has been added, it doesn't show in the list of added accounts. – ataulm Nov 08 '15 at 15:57