i tryed your code, but it doesn't work on 1.6 :-(

E/AndroidRuntime(  429): java.lang.IllegalArgumentException: Unknown URL
content://sync/settings
E/AndroidRuntime(  429):        at
android.content.ContentResolver.insert(ContentResolver.java:476)


On Fri, Apr 23, 2010 at 11:38, cpphool <[email protected]> wrote:

> I have added one modification and snippet works on htc magic (1.5)
>
>  final Uri CONTENT_URI = Uri.parse("content://sync/settings");
>  ContentValues values = new ContentValues();
>  values.put("name", "sync_provider_contacts");
>  values.put("value", "true"); // <-- here - string "true" instead of
> boolean
>  getContentResolver().insert(CONTENT_URI, values);
>
> On 21 Kwi, 15:12, remy berrebi <[email protected]> wrote:
> > good news about android 2.x but actually, i want to make my application
> > available for all major android version, like 1.6 and if possible 1.5
> >
> > i'm still searching information.
> > actually i'm trying to understand reflect mechanism, to see if i can call
> > HIDE method and class and act on sync setting.
> > but for now nothing work :-(
> >
> >
> >
> > On Tue, Apr 20, 2010 at 16:25, cpphool <[email protected]> wrote:
> > > [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]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[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]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> > > For more options, visit this group at
> > >http://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]<android-developers%[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]<android-developers%[email protected]>
> For more options, visit this group at
> http://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