Skip to content

Commit

Permalink
Resolve #26 by changing Activity to Context (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
encosw authored and Acconut committed Dec 1, 2018
1 parent dc0a53a commit e78f1ab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.tus.android.client;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
Expand All @@ -16,8 +16,8 @@
import io.tus.java.client.TusUpload;

public class TusAndroidUpload extends TusUpload {
public TusAndroidUpload(Uri uri, Activity activity) throws FileNotFoundException {
ContentResolver resolver = activity.getContentResolver();
public TusAndroidUpload(Uri uri, Context context) throws FileNotFoundException {
ContentResolver resolver = context.getContentResolver();
Cursor cursor = resolver.query(uri, new String[]{OpenableColumns.SIZE, OpenableColumns.DISPLAY_NAME}, null, null, null);
if(cursor == null) {
throw new FileNotFoundException();
Expand Down

0 comments on commit e78f1ab

Please sign in to comment.