And what if I'm outside these, which seems to be my issue.  I have the
Activity call a service class which starts a background tread. In this
background I'm calling another class to populate properties and
ContentResolver gives me an error 'Android.Content.ContentResolver' is a
'type' but is used like a 'variable'    



-----Original Message-----
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Tuesday, July 26, 2011 10:23 AM
To: Discussions related to Mono for Android
Subject: Re: [mono-android] ID

On Jul 26, 2011, at 9:31 AM, Tim Kelly wrote:
> Android.Provider.Settings.Secure.GetString( XXXXXXXX ,
Android.Provider.Settings.Secure.AndroidId);
>  
> What actually goes where the XXXXXXXX are?

`XXXXXXXX` is a ContentResolver instance, which you can obtain via the
Context.ContentResolver property:

        
http://docs.mono-android.net/Android.Content.Context.ContentResolver

If you're within a Context subclass (e.g. Activity, or Service), then
you can just use:

        Android.Provider.Settings.Secure.GetString(ContentResolver,
Android.Provider.Settings.Secure.AndroidId);

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to