Witek
Witek

Reputation: 6472

How to start Android accounts configuration for my custom accountType?

In my app I have configured a custom accountType which is defined in my authenticator.xml. Accounts created by my app are already visible in global settings.

Since android already provides a user interface for deleting and configuring such accounts, I would like to start it from my app, so I don't have to implement this functionality myself.

What is the code for creating the required intent to jump directly to account configuration for my custom accountType?

Upvotes: 1

Views: 211

Answers (1)

Dage
Dage

Reputation: 236

import android.provider.Settings;
ctx.startActivity(new Intent(Settings.ACTION_SYNC_SETTINGS));

Add an extra to that intent called Settings.EXTRA_AUTHORITIES with a value that is your account's authority, you can limit the accounts shown to just yours. The value has to be in a string array.

Upvotes: 1

Related Questions