My problem is that I do not know how to direct the data to two activitys of the selected item ... I am a newbie and I was testing with the if and it seems to be wrong because I can not select the other items.
viewHolder.setOnClickListener(new ViewHolder.ClickListener() {
@Override
public void onItemClick(View view, int position) {
String mTitle = getItem(position).getTitle();
String mDesc = getItem(position).getDescripcion();
String mImage = getItem(position).getImage();
String mLugar = getItem(position).getLugar();
if(position ==0){
Intent intent=new Intent(view.getContext(),PostDetailActivity.class);
intent.putExtra("image", mImage);
intent.putExtra("title", mTitle);
intent.putExtra("descripcion", mDesc);
intent.putExtra("lugar",mLugar);
startActivity(intent);
}
if(position ==0){
Intent intent=new
Intent(view.getContext(),PostDetail2Activity.class);
intent.putExtra("image", mImage);
intent.putExtra("title", mTitle);
intent.putExtra("descripcion", mDesc);
intent.putExtra("lugar",mLugar);
startActivity(intent);
}
}
@Override
public void onItemLongClick(View view, int position) {
}
});
return viewHolder;
in this activity
I put a button to enter the other activity
but I get empty:
String image =getIntent().getStringExtra("image");
String title=getIntent().getStringExtra("title");
String desc=getIntent().getStringExtra("descripcion");
String lug=getIntent().getStringExtra("lugar");
mTitleTv.setText(title);
mDetailTv.setText(desc);
Picasso.get().load(image).into(mImageIv);
mBtn_hora.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent =new Intent(PostDetailActivity.this,PostDetail2Activity.class);
startActivity(intent);
}
});