From 5b6140dc645200fbc4d63c65cb8c28e824b2b6d0 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 2 Jun 2014 21:27:40 +0200 Subject: [PATCH] long press on images revails share with intent --- .../conversations/ui/ConversationFragment.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index def76b907..b51d8e0aa 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -38,6 +38,7 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; +import android.view.View.OnLongClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; @@ -331,6 +332,18 @@ public class ConversationFragment extends Fragment { startActivity(intent); } }); + viewHolder.image.setOnLongClickListener(new OnLongClickListener() { + + @Override + public boolean onLongClick(View v) { + Intent shareIntent = new Intent(); + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_STREAM, ImageProvider.getContentUri(message)); + shareIntent.setType("image/*"); + startActivity(Intent.createChooser(shareIntent, getText(R.string.share_with))); + return true; + } + }); } @Override