com.smartmeapp.monitor.HistoryBrowser.AbstractProviderBrowser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of monitor Show documentation
Show all versions of monitor Show documentation
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;
}
}