Example usage for android.content Context getContentResolver

List of usage examples for android.content Context getContentResolver

Introduction

In this page you can find the example usage for android.content Context getContentResolver.

Prototype

public abstract ContentResolver getContentResolver();

Source Link

Document

Return a ContentResolver instance for your application's package.

Usage

From source file:Main.java

public static ContentResolver getContentProvider(Context ctx) {
    return ctx.getContentResolver();
}

From source file:Main.java

public static void deleteAllCallLogs(Context context) {
    context.getContentResolver().delete(URI, null, null);
}

From source file:Main.java

private static Cursor getContactCursor(Context context) {
    return context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
            new String[] { ContactsContract.CommonDataKinds.Phone._ID,
                    ContactsContract.CommonDataKinds.Phone.NUMBER,
                    ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME },
            ContactsContract.CommonDataKinds.Phone.NUMBER + " IS NOT NULL", null, null);
}

From source file:Main.java

public static String getDeviceId(Context ctxt) {
    return Secure.getString(ctxt.getContentResolver(), Secure.ANDROID_ID);
}

From source file:Main.java

public static String getAndroidId(Context ctx) {
    return Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID);
}

From source file:Main.java

public static String getDeviceId(Context context) {
    return Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
}

From source file:Main.java

public static String getAndroidId(Context context) {
    return Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
}

From source file:Main.java

public static String getAndroidId(Context context) {
    return System.getString(context.getContentResolver(), "android_id");
}

From source file:Main.java

public static String getRealPathFromURI(Uri uri, Context context) {
    Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
    cursor.moveToFirst();//from   ww w.jav a 2s . c om
    int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
    return cursor.getString(idx);
}

From source file:Main.java

/**
 * get a unique identifier for this android device
 * @param ctx/*from  ww  w .ja v a 2s  . c o m*/
 */
public static String getUniqueDeviceId(Context ctx) {
    return Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID);
}