DropDataContentProvider


public final class DropDataContentProvider extends ContentProvider


WebView provides partial support for Android Drag and Drop allowing images, text and links to be dragged out of a WebView.

The content provider is required to make the images drag work, to enable, you should add this class to your manifest, for example:

 <provider
            android:authorities="<your-package>.DropDataProvider"
            android:name="androidx.webkit.DropDataContentProvider"
            android:exported="false"
            android:grantUriPermissions="true"/>

Summary

Public constructors

Public methods

@Nullable Bundle
call(@NonNull String method, @Nullable String arg, @Nullable Bundle extras)
int
delete(
    @NonNull Uri uri,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)
@Nullable String
@Nullable Uri
insert(@NonNull Uri uri, @Nullable ContentValues contentValues)
boolean
@Nullable ParcelFileDescriptor
@Nullable Cursor
query(
    @NonNull Uri uri,
    @Nullable String[] projection,
    @Nullable String selection,
    @Nullable String[] selectionArgs,
    @Nullable String sortOrder
)
int
update(
    @NonNull Uri uri,
    @Nullable ContentValues contentValues,
    @Nullable String s,
    @Nullable String[] strings
)

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From android.content.ContentProvider
ContentProviderResult[]
applyBatch(
    String authority,
    ArrayList<ContentProviderOperation> operations
)
void
attachInfo(Context context, ProviderInfo info)
int
bulkInsert(Uri uri, ContentValues[] values)
Bundle
call(String authority, String method, String arg, Bundle extras)
Uri
final ContentProvider.CallingIdentity
void
dump(FileDescriptor fd, PrintWriter writer, String[] args)
final AttributionSource
final String
final String
final String
final Context
final PathPermission[]
final String
String[]
getStreamTypes(Uri uri, String mimeTypeFilter)
String
final String
boolean
void
void
void
void
onTrimMemory(int level)
AssetFileDescriptor
openAssetFile(Uri uri, String mode)
final ParcelFileDescriptor
openFileHelper(Uri uri, String mode)
ParcelFileDescriptor
<T> openPipeHelper(
    Uri uri,
    String mimeType,
    Bundle opts,
    T args,
    ContentProvider.PipeDataWriter<T> func
)
AssetFileDescriptor
openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)
boolean
refresh(Uri uri, Bundle extras, CancellationSignal cancellationSignal)
final Context
final void
final void
setPathPermissions(PathPermission[] permissions)
final void
final void
void
Uri

Public constructors

DropDataContentProvider

Added in 1.7.0
public DropDataContentProvider()

Public methods

call

public @Nullable Bundle call(@NonNull String method, @Nullable String arg, @Nullable Bundle extras)

delete

Added in 1.7.0
public int delete(
    @NonNull Uri uri,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)

getType

Added in 1.7.0
public @Nullable String getType(@NonNull Uri uri)

insert

Added in 1.7.0
public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues)

onCreate

Added in 1.7.0
public boolean onCreate()

query

Added in 1.7.0
public @Nullable Cursor query(
    @NonNull Uri uri,
    @Nullable String[] projection,
    @Nullable String selection,
    @Nullable String[] selectionArgs,
    @Nullable String sortOrder
)

update

Added in 1.7.0
public int update(
    @NonNull Uri uri,
    @Nullable ContentValues contentValues,
    @Nullable String s,
    @Nullable String[] strings
)