I have fragment where I get the string in List and send it as Bundle to the activity. For Example I get a string and and send it to an activity by following way:
public class ViewPagerAdapter extends FragmentStatePagerAdapter
{
private CharSequence contentTitle[];
public ViewPagerAdapter(Response<album> response)
{
List<String> listcontentTitle = new ArrayList<>();
List<List<String>> latest_list = new ArrayList<>();
List<String> latestdate = new ArrayList<>();
List<String> latestcomment = new ArrayList<>();
for (int i = 0; i < 5; i++)
{
listcontentTitle.add(String.valueOf(response.body().getcontent().get(i).getcontentTitle()));
latestdate.add(String.valueOf(response.body().getcontent().get(i).getcontentdate()));
latestcomment.add(String.valueOf(response.body().getcontent().get(i).getcontentcmnt()));
}
latest_list.add(latestdate);
latest_list.add(latestcomment);
this.contentTitle = listcontentTitle.toArray(new CharSequence[listcontentTitle.size()]);
// (1) access latest_list with this keyword
}
@Override
public Fragment getItem(int position)
{
Fragment Detail=new Detail(mContext);
Bundle bundle= new Bundle();
bundle.putString("content_title",contentTitle[position].toString());
// (2) pass the latest list in bundle
Detail.setArguments(bundle);
return Detail;
}
}
Now what should be my (1) and (2) in order to access latest_list and pass it in bundle?