I have a Recycler View Adapter that manages Card Views. The cards have a button that should launch another activity.
However, for some reason EXTRA_MESSAGE isn't being recognized. I have defined it in my main activity, so I'm not sure what the problem is. Here is the code:
@Override
public void onBindViewHolder(final View_Holder holder, final int position) {
//Use the provided View Holder on the onCreateViewHolder method to populate the current row on the RecyclerView
holder.name.setText(list.get(position).name);
holder.number.setText("Character # " + list.get(position).number);
holder.imageView.setImageBitmap(decodeSampledBitmapFromResource(context.getResources(), (list.get(position).imageId), 60, 60));
holder.fullbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, CardFullView.class);
intent.putExtra(Intent.EXTRA_MESSAGE, list.get(position));
context.startActivity(intent);
}
});
and the definition in MainActivity.java
public final static String EXTRA_MESSAGE = "com.package.name.MESSAGE";
Change
Intent.EXTRA_MESSAGE
To
MainActivity.EXTRA_MESSAGE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With