Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start activity Manage Accounts / Sync Settings on Android?

What intent to start to show Manage Accounts / Sync Settings activity? What is the easiest way to lookup intents for such system activities?

SOLUTION: Thanks to hint from @cant0na, to start Manage Accounts activity:

new Intent("android.settings.SYNC_SETTINGS")

How to lookup intents see @cant0na's answer.

like image 704
TN. Avatar asked Jun 14 '11 09:06

TN.


People also ask

How do I turn on sync on Android?

Step 1: Tap the menu in the top left to see your preferences and other options. Step 2: Tap on the Manage Auto Sync text to open auto sync preferences on your device. Step 3: Tap the green Turn Auto Sync On button to enable auto sync.

What happens if auto sync is off?

Tip: Turning off auto-sync for an app doesn't remove the app. It only stops the app from automatically refreshing your data. Open your phone's Settings app. Account sync.


Video Answer


2 Answers

startActivity( new Intent(Settings.ACTION_SYNC_SETTINGS));

you can even enhance the intent with extra,so that only accounts that have adapters for those authorities are displayed:

String[] authorities = {"authority1", "authority2"};
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
intent.putExtra(Settings.EXTRA_AUTHORITIES, authorities);
like image 101
rds Avatar answered Nov 08 '22 05:11

rds


The easiest way to find which intents to use is to see in logcat in eclipse or ddms while opening the app on your phone.

It will look something like this:

ActivityManager(2690): Starting: Intent { cmp=com.android.providers.subscribedfeeds/com.android.settings.ManageAccountsSettings } from pid 19036
like image 35
Eric Nordvik Avatar answered Nov 08 '22 05:11

Eric Nordvik