Hi i have a listview with textview in every row with a text linkified with defined pattern in it , i use this small code to make linkified items can be clickable and call another activity in my app.But before that i am using imaview above the list to make navigation appear on listview , when i added
textView.setMovementMethod(LinkMovementMethod.getInstance());
Pattern Matcher = Pattern.compile("pattern here");
String Url = "sth://";
Linkify.addLinks(entrySpan, Matcher, Url);
Instead of onClick method of listview on just linkfy clicks are working , but i have to make them work bot
Here is code that i am using for listview click method but this seems never firing after setting linkify set movement , i am switching back and forth between Vısıble and Gone after every click.
getListView().setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
if(Entry.totalPageNumber>1){
//if no more than one page exist no need to navigate
if(show == false){
findViewById(R.id.back).setVisibility(View.VISIBLE);
findViewById(R.id.forward).setVisibility(View.VISIBLE);
findViewById(R.id.start).setVisibility(View.VISIBLE);
findViewById(R.id.last).setVisibility(View.VISIBLE);
show=true;
}else if(show==true){
findViewById(R.id.back).setVisibility(View.GONE);
findViewById(R.id.forward).setVisibility(View.GONE);
findViewById(R.id.start).setVisibility(View.GONE);
findViewById(R.id.last).setVisibility(View.GONE);
show=false;
}
}
}
});
How to resolve this problem??
I resolved it , just moved the onClickListener implementation into my getView method which draw textview and directly apply onClickListener to textView and finally both of them working happily