I tried several ways but failed. the last try is giving me this error.
error: incompatible types: ArrayList cannot be converted to ArrayList<? extends Parcelable> shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,myList);
public void onBindViewHolder(@NonNull final ExampleViewHolder holder, final int i) {
ListQuotes currentItem = exampleList.get(i);
holder.textView1.setText(currentItem.getArabicText());
holder.textView2.setText(currentItem.getEnglishText());
holder.numbering.setText(String.valueOf(i+1));
holder.share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ArrayList<String> myList = new ArrayList<String>();
myList.add(exampleList.get(i).getArabicText()); // Add your image URIs here
myList.add(exampleList.get(i).getEnglishText());
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,myList);
shareIntent.setType("text/plain");
mContext.startActivity(Intent.createChooser(shareIntent, null));
}
});
}