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

3

6

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.

Macrocosm answered 14/6, 2011 at 9:26 Comment(1)
cant0na is now known as @Eric Nordvik, unless I am mistaken.Allbee
G
4

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
Gaudet answered 14/6, 2011 at 9:28 Comment(2)
cmp stand for Component. To find and intent which you can register a receiver, I think you need to have: Starting: Intent { action=some.action }Gaudet
On KitKat / Android L this looks slightly different: I/ActivityManager( 627): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)}Cramp
T
6
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);
Tedra answered 7/10, 2012 at 22:51 Comment(0)
G
4

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
Gaudet answered 14/6, 2011 at 9:28 Comment(2)
cmp stand for Component. To find and intent which you can register a receiver, I think you need to have: Starting: Intent { action=some.action }Gaudet
On KitKat / Android L this looks slightly different: I/ActivityManager( 627): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)}Cramp
B
0

as @cant0na said that is the best way. the alternative would be going through the source code or for some of the available intents that you can register you can go to the manifest and set a intent filter and in the GUI of the manifest there are some of the available actions listed to add to the intent filter.

also this link has all of them listed with explanations:

Intent Reference

Beamer answered 14/6, 2011 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.