Get value from ContentResolver - Android Database

Android examples for Database:ContentValues

Description

Get value from ContentResolver

Demo Code


//package com.java2s;

import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings;

public class Main {
    public static boolean getDefaultState(final Context context) {
        final ContentResolver cr = context.getContentResolver();
        final int mobileData = Settings.Secure.getInt(cr, "mobile_data", 0);
        return mobileData != 0;
    }/* w  w w  .  jav  a2  s .com*/
}

Related Tutorials