All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartmeapp.monitor.HistoryBrowser.AbstractProviderBrowser Maven / Gradle / Ivy

Go to download

Including android-maven and others all in monitor namespace. URL and CSM of project.

The newest version!
package com.smartmeapp.monitor.HistoryBrowser;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;

import me.everything.providers.core.Data;
import me.everything.providers.core.Entity;

/**
 * Created by Juan Martinez on 30/03/17.
 */

public abstract class AbstractProviderBrowser {

    protected String TAG;
    private ContentResolver mContentResolver;

    protected AbstractProviderBrowser(Context context) {
        TAG = getClass().getName();
        mContentResolver = context.getContentResolver();
    }

    protected  Data getContentTableData(Uri uri, Class cls) {
        Cursor cursor = mContentResolver.query(uri, Entity.getColumns(cls), null, null, null /*BaseColumns._ID + " DESC " + " LIMIT 50" */);
        if (cursor == null) {
            return null;
        }

        Data data = new Data(cursor, cls);
        return data;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy