I am working on an application where I need to parse some text which may have some links.
When one of links contains a certain value, for example, www.abc.com
and is tapped, I must open one of my activities.
I've tried the code in this accepted answer but but have been unable to make it work.
When I click on a link, I have nothing, I've tried to put some logging, for example:
public void onClick(View view) {
Log.e("test",span.getURL());
}
But nothing is logged, it seems like I ever tapped on the link.
In my activity, I save data with an AsyncTask
(it's ok, it works!) and in my onPostExecute
method, I do:
protected void onPostExecute(Void result) {
if(_flagOk){
/* .... */
setTextViewHTML(_contenu,datas); //where data is html code
}
}
With the code of the link from above.