我有来自json回复的listivew和fill listview
在适配器类中,我有一个类似
在我的json回复中,我的帖子就像发帖一样,即当我发送我的用户ID时,它给了我所有的帖子,并且在特殊帖子的json回复中,我得到了状态,即"是"或"不"
我做了什么:
适配器类:
ivPostLike.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View tempView = (View) v.getTag(R.integer.btnplusview);
pos = (Integer) v.getTag(R.integer.btnpluspos);
ivPostLike = (ImageView) tempView.findViewById(R.id.ivPostLike);
like_feed = String.valueOf(pos);
Log.e("posssstre", post_id);
if (likeStatus.equals(null))
{
return;
}
else {
if (likeStatus.equals("yes"))
{
like = "no";
ivPostLike.setBackgroundResource(R.mipmap.icon_heart);
}
else {
like = "yes";
ivPostLike.setBackgroundResource(R.drawable.heartlike);
}
}
likePost(like);
}
});
tvPostDetail.setMovementMethod(new ScrollingMovementMethod());
return itemView;
}
Json的回应:
"status": true,
"message": "Successfully Get user list data",
"data": [
{
"user_id": "50",
"post_id": "61",
"text": "Hellooo ,, Testing"
"status": [
{
"likestatus": "yes"
}
]
},
{
"user_id": "50",
"post_id": "50",
"text": "Hello",
"status": [
{
"likestatus": "yes"
}
]
}
]
}
我没有在点击上获得特定项目,即如果我点击第61号帖子我会在第50号帖子上得到赞成
点击时ID错误,位置与点击