Dummy-Konto für Sync Adapter in den Einstellungen ausblenden

Ich habe einen Synchronisierungsadapter mit einem Dummy-Konto erstellt und möchte nicht, dass er in der Kontoliste der Anwendung "Einstellungen" angezeigt wird oder wenn ein Benutzer in den Einstellungen auf die Schaltfläche "Konto hinzufügen" klickt. Ich habe versucht, android: userVisible = "false" in meiner Sync-Adapter-Definition, aber immer noch das Konto angezeigt. Ich habe dies auf einem Emulator und 3 physischen Geräten versucht. Alles funktioniert korrekt, da alle von mir benötigten Daten synchronisiert werden. Das Einzige, was falsch ist, ist, dass ich das Konto auf der Liste sehe und nicht möchte.

Meine authenticator.xml ist:

<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
                   android:accountType="net.astagor.android.hhp.account"
                   android:icon="@drawable/ic_launcher"
                   android:smallIcon="@drawable/ic_launcher"
                   android:label="@string/app_name"
    />

Meine syncadapter.xml ist:

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
          android:contentAuthority="net.astagor.android.hhp"
          android:accountType="net.astagor.android.hhp.account"
          android:userVisible="false"
          android:supportsUploading="true"
          android:allowParallelSyncs="false"
          android:isAlwaysSyncable="true"
    />

Und ich füge meinen Adpater so hinzu:

 Account account = AuthenticatorService.GetAccount();

 AccountManager accountManager = (AccountManager) context
    .getSystemService(Context.ACCOUNT_SERVICE);

 if (accountManager.addAccountExplicitly(account, null, null)) {

ContentResolver.setIsSyncable(account, StubProvider.AUTHORITY, 1);

ContentResolver.setSyncAutomatically(account,
        StubProvider.AUTHORITY, true);

ContentResolver.addPeriodicSync(account, StubProvider.AUTHORITY,
        new Bundle(), SYNC_FREQUENCY);
 }

Und das bekomme ich in der Kontoliste und in der Kontoliste hinzufügen.

Hilfe bitte! :)

Antworten auf die Frage(2)

Ihre Antwort auf die Frage