How to check if background data is enabled on the android?
<p>I want to check if the user enabled background data on his/her device and display a message if it is disabled.</p>

<p>How can I check if it has been enabled?
I tried </p>

<pre><code>import android.provider.Settings;

//...
Settings.System.getString(getContentResolver(), Settings.Secure.BACKGROUND_DATA);
//and
Settings.Secure.getString(getContentResolver(), Settings.Secure.BACKGROUND_DATA);
</code></pre>

<p>But they are returning null.</p>

<p>Thank you,
Achie.</p>
