I have two String list to send to an activity from an adapter in android.
I have these two arrays in my adapter,
private final List<String> toppingPriceTop;
private final List<String> toppingDescriptionTop;
and in my adapter I have this button, this button click sending these details to the activity,
customize.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent next = new Intent(context, ActivityCustomize.class);
next.putExtra("description", descriptions.get(position));
next.putExtra("imageUrl", imageUrls.get(position));
next.putExtra("toppingDescriptionTop", toppingDescriptionTop.get(position));
next.putExtra("toppingPriceTop", toppingPriceTop.get(position));
context.startActivity(next);
((Activity) context).overridePendingTransition(
R.anim.slide_in_right, R.anim.slide_out_left);
}
In my activity I'm receiving these data as,
String [] toppingPriceTop = getIntent().getStringArrayExtra("toppingPriceTop");
String [] toppingDescriptionTop = getIntent().getStringArrayExtra("toppingDescriptionTop");
String imageUrl = getIntent().getStringExtra("imageUrl");
String description = getIntent().getStringExtra("description");
My problem is I'm getting values for imageUrl and description in the activity but for both the list arrays I'm getting null. an anyone tell me where I have gone wrong and how can I correct this please. Any help will be appreciated.