I'm currently parsing JSON in my android app (note that I am quite new to this stuff; both android and JSON). Now I got a JSONObject and inside this object a JSONArray with links (strings) inside them. I'd like to put these links inside the array inside a Textview and make them also clickable.
Using Log.w i could retrieve the following output:
<a href="http://xxxx.xx/xxxx/test.xlsx">test.xlsx</a>
The URL seems valid, but everything I try to make them actually be links seem to fail. This is the code that I use to retrieve the links:
ArrayList<String> map; //note it's already filled and contains strings like the example
sb = new StringBuilder("Items in map:\n\n");
for(int i=0;i<map.size();i++){
sb.append(Html.fromHtml("• " + map.get(i) + "<br/>"));
}
Now I "empty" the stringbuilder into my TextView:
TextView overView= (TextView)findViewById(R.id.textOverView);
overView.setText(sb.toString());
//make links clickable?
overView.setMovementMethod(LinkMovementMethod.getInstance());
I've also tried to use Linkify, the android:clickable properties, url encoders and many more, but unfortunately nothing seems to work. If I remove the setMoveMent method the links are not even blue (let alone clickable), the same goes for all the other methods.
Any ideas are most welcome!