Thank you guys that worked.

ConnectivityManager cm = (ConnectivityManager)
getSystemService(this.CONNECTIVITY_SERVICE);
boolean bgData = cm.getBackgroundDataSetting();

On Dec 20, 3:14 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Use getBackgroundDataSetting() on ConnectivityManager. If you really
> feel you need to get it from Settings, use:
>
> Settings.Secure.getInt(mContext.getContentResolver(),
>                 Settings.Secure.BACKGROUND_DATA, 1) == 1
>
> to get a boolean indicator.
>
>
>
>
>
>
>
>
>
> On Mon, Dec 20, 2010 at 5:07 PM, Achie <krishna.acha...@gmail.com> wrote:
> > I want to check if the user enabled background data on his/her device
> > and display a message if it is disabled.
>
> > How can I check if it has been enabled?
> > I tried
> > Settings.System.getString(getContentResolver(),
> > Settings.Secure.BACKGROUND_DATA);
> > and
> > Settings.Secure.getString(getContentResolver(),
> > Settings.Secure.BACKGROUND_DATA);
>
> > But they are returning null.
>
> > Thank you,
> > Achie.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

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

Reply via email to