[android 2.x]

as far as i know, Android 2.x introduces completely new sync mechanism
(allowing use to use multi accounts). In order to check whether global
auto-sync is on, you can use:

 ContentResolver.getMasterSyncAutomatically();

and to switch it on:

 ContentResolver.setMasterSyncAutomatically(true);

[android 1.x]

Did you find something about 1.6? and are you able to change auto-sync
settings in 1.5?

I tried with this snippet:

 final Uri CONTENT_URI = Uri.parse("content://sync/settings");
 ContentValues values = new ContentValues();
 values.put("name", "sync_provider_contacts");
 values.put("value", true);
 getContentResolver().insert(CONTENT_URI, values);

The value changes to "1" instead of "true" and it doesn't affect sync
settings.

On 16 Kwi, 17:53, zehunter <[email protected]> wrote:
> hi,
>
> i'm not able to find any example or documentation or tutorial about
> how to enable or disable sync (background data and auto sync)
> programmaticaly, even if i can found many widget that can do that
> without root access or such.
>
> is it something secret? :-)
> can any one may be good enough to help me and explain how this work
> and how to implement that into my code?
>
> i found some trick with URI and content://sync/setting but it seems to
> be not possible with android 1.6 at least :-( any idea why? and what
> replaced this?
>
> thanks a thousand time for all people that will answer to me.
> best regards,
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to