public abstract class ContentProviderBase
extends android.content.ContentProvider
InfoSource / ImageSource.
You must also implement ResourceForContentType(DlcType),
which returns the resource id of the raw file associated with the specified type.
For example, if your custom class is in a file called res/raw/classes.textpb, a call
to ResourceForContentType(CLASS) should return R.id.classes. If your content pack does not
contain content of a particular type, you should throw a
ContentNotSupportedException
when ResourceForContentType is called for that type.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ContentProviderBase.ContentNotSupportedException
Throw this from
ResourceForContentType if your
content pack does not support the specified DlcType. |
| Constructor and Description |
|---|
ContentProviderBase() |
| Modifier and Type | Method and Description |
|---|---|
android.os.Bundle |
call(java.lang.String method,
java.lang.String arg,
android.os.Bundle extras) |
int |
delete(android.net.Uri uri,
java.lang.String s,
java.lang.String[] strings) |
java.lang.String |
getType(android.net.Uri uri) |
android.net.Uri |
insert(android.net.Uri uri,
android.content.ContentValues contentValues) |
boolean |
onCreate() |
android.database.Cursor |
query(android.net.Uri uri,
java.lang.String[] columns,
java.lang.String where,
java.lang.String[] where_value_substitution,
java.lang.String sort_order) |
protected abstract int |
ResourceForContentType(DlcType type) |
int |
update(android.net.Uri uri,
android.content.ContentValues contentValues,
java.lang.String s,
java.lang.String[] strings) |
applyBatch, applyBatch, attachInfo, bulkInsert, call, canonicalize, clearCallingIdentity, delete, dump, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, insert, isTemporary, onCallingPackageChanged, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, requireContext, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalize, updateprotected abstract int ResourceForContentType(DlcType type) throws ContentProviderBase.ContentNotSupportedException
type - The type of DLC being requested. This is never called for ICON or IMAGE types.ContentProviderBase.ContentNotSupportedException - If your content pack does not support the specified content type.public android.os.Bundle call(@NonNull
java.lang.String method,
@Nullable
java.lang.String arg,
@Nullable
android.os.Bundle extras)
call in class android.content.ContentProvidermethod - Specifies the type of content being requested:
"backgrounds", "class_spells", "classes", "feats", "items", "spells", "talents", "info", or "image".arg - For "info" and "image", the content path specified in the InfoSource / ImageSourceextras - Not usedpublic java.lang.String getType(@NonNull
android.net.Uri uri)
getType in class android.content.ContentProvideruri - Not usedpublic boolean onCreate()
onCreate in class android.content.ContentProvider@Nullable
public android.database.Cursor query(@NonNull
android.net.Uri uri,
@Nullable
java.lang.String[] columns,
@Nullable
java.lang.String where,
@Nullable
java.lang.String[] where_value_substitution,
@Nullable
java.lang.String sort_order)
query in class android.content.ContentProvider@Nullable
public android.net.Uri insert(@NonNull
android.net.Uri uri,
@Nullable
android.content.ContentValues contentValues)
insert in class android.content.ContentProviderpublic int delete(@NonNull
android.net.Uri uri,
@Nullable
java.lang.String s,
@Nullable
java.lang.String[] strings)
delete in class android.content.ContentProviderpublic int update(@NonNull
android.net.Uri uri,
@Nullable
android.content.ContentValues contentValues,
@Nullable
java.lang.String s,
@Nullable
java.lang.String[] strings)
update in class android.content.ContentProvider