Implemented AttachmentProvider, removed ContentAttachment.getUri()

This commit is contained in:
str4d
2014-12-29 10:50:04 +00:00
parent 60615829da
commit 95b5e6684b
8 changed files with 327 additions and 84 deletions

View File

@@ -444,11 +444,11 @@ public class NewEmailFragment extends Fragment {
private void addAttachment(Uri uri) {
// Try to create a ContentAttachment using the provided Uri.
try {
final ContentAttachment attachment = new ContentAttachment(getActivity().getContentResolver(), uri);
final ContentAttachment attachment = new ContentAttachment(getActivity(), uri);
final View v = getActivity().getLayoutInflater().inflate(R.layout.listitem_attachment, mAttachments, false);
v.setTag(attachment);
((TextView) v.findViewById(R.id.filename)).setText(attachment.getFileName());
((TextView) v.findViewById(R.id.size)).setText(attachment.getHumanReadableSize(getActivity()));
((TextView) v.findViewById(R.id.size)).setText(attachment.getHumanReadableSize());
v.findViewById(R.id.remove_attachment).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {