Fix shared mime types

master
M66B 3 months ago
parent e33cd36385
commit 71c8495a6c

@ -51,17 +51,23 @@ public class UriType implements Parcelable {
} }
} else } else
this.type = type; this.type = type;
fixMimeType(context);
} }
public UriType(Uri uri, String type, Context context) { public UriType(Uri uri, String type, Context context) {
type = "image/*";
this.uri = uri; this.uri = uri;
if (!TextUtils.isEmpty(type)) if (!TextUtils.isEmpty(type))
this.type = type; this.type = type;
fixMimeType(context);
}
//if (context != null) { private void fixMimeType(Context context) {
// Helper.UriInfo info = Helper.getInfo(this, context); if (context != null &&
// this.type = EntityAttachment.getMimeType(type, info.name); (type == null || type.endsWith("/*"))) {
//} Helper.UriInfo info = Helper.getInfo(this, context);
this.type = EntityAttachment.getMimeType(type, info.name);
}
} }
public Uri getUri() { public Uri getUri() {

Loading…
Cancel
Save