long press on images revails share with intent

This commit is contained in:
iNPUTmice 2014-06-02 21:27:40 +02:00
parent 236453295c
commit 5b6140dc64
1 changed files with 13 additions and 0 deletions

View File

@ -38,6 +38,7 @@ import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
@ -331,6 +332,18 @@ public class ConversationFragment extends Fragment {
startActivity(intent); 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 @Override