I am using an custom listview in my application.In my row I have (two images,remaining textviews).
when I click on one of textview,I want to set another textview data.I wrote the code below to do this
likes.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// if(likes.getText().toString().equals("Like")){
TextView t=(TextView)v;
TextView likesnumber1 = (TextView) findViewById(R.id.likesnumber);
// TextView likesnumber = (TextView) convertView.findViewById(R.id.likesnumber);
int i= Integer.parseInt(likescount.get(position));
if(like_or_ulike.get(position).equals("Like")){
Log.e("inlike","like");
like_or_ulike.set(position, "Unlike");
t.setText(like_or_ulike.get(position));
UrltoValue.getValuefromUrl("https://graph.facebook.com/"+objectid.get(position)+"/likes?access_token="+accesstoken+"&method="+"post");
// listView.getAdapter().getItemAt(position);
j=i+1;
String s=Integer.toString(j);
likescount.set(position, s);
likesnumber1.setText(likescount.get(position));
}
else{
Log.e("unlike","unlike");
like_or_ulike.set(position, "Like");
t.setText(like_or_ulike.get(position));
UrltoValue.getValuefromUrl("https://graph.facebook.com/"+objectid.get(position)+"/likes?access_token="+accesstoken+"&method="+"DELETE");
j=i-1;
String s=Integer.toString(j);
likescount.set(position, s);
likesnumber1.setText(likescount.get(position));
}
}
});
How can I get the another textview id of particular row when I click the textview.Is it possible to get the ids of that particular row.
As you want to get hold of the textview in the same row, you can do the following.
with the textview that was clicked get its parent and then using the parentview you can search for your textview:
you will need to change the id that you look for to the id you have for that other textview. If you need to set an id you can do this in the xml layout file you used.
I cant follow your code well enough to actually give you the code but this should be enough to get you in the right direction.