Refactoring

This commit is contained in:
M66B 2019-08-24 09:52:39 +02:00
parent 2ccdd8fa08
commit 24d290a3ef
2 changed files with 4 additions and 4 deletions

View File

@ -218,11 +218,11 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
private void onShare(EntityAttachment attachment) {
// https://developer.android.com/reference/android/support/v4/content/FileProvider
File file = attachment.getFile(context);
final Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
Log.i("uri=" + uri);
// Build intent
final Intent intent = new Intent(Intent.ACTION_VIEW);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, attachment.type);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (!TextUtils.isEmpty(attachment.name))

View File

@ -113,11 +113,11 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
File file = attachment.getFile(context);
// https://developer.android.com/reference/android/support/v4/content/FileProvider
final Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
Log.i("uri=" + uri);
// Build intent
final Intent intent = new Intent(Intent.ACTION_VIEW);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, attachment.type);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
if (!TextUtils.isEmpty(attachment.name))