Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.database.Cursor;

import android.provider.ContactsContract.DisplayPhoto;

public class Main {
    public static int getMaxSize(Context context) {
        // Note that this URI is safe to call on the UI thread.
        Cursor c = context.getContentResolver().query(DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI,
                new String[] { DisplayPhoto.DISPLAY_MAX_DIM }, null, null, null);
        try {
            c.moveToFirst();
            return c.getInt(0);
        } finally {
            c.close();
        }
    }
}