Dynamic linking of text in ListView - Error: no intentions found with data: specified URL

I am creating a listview . in this list, each item has a text view . and in textual representations, I define linking texts based on data from a web service ..

now when i click on this link text i get an error like

09-21 20:27:38.031: ERROR/AndroidRuntime(766): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=\"ticbeat.com/socialmedia/fa…" (has extras) 

please help me solve this problem .. any answer with a solution would be highly appreciated.

Update:

code:

 if(urlentities[position]!=null && dpurlentities[position]!=null) holder.twtdata.setText(Html.fromHtml(timelines[position].replace(urlentities[position],"<a href=\\\""+dpurlentities[position]+"\">"+urlentities[position]+"</a>"))); 
+4
source share
2 answers

It looks like you need to put http:// at the beginning of this url. Without the protocol specifier, Android seems to assume that "content: //" is the type of the supposed URL.

+8
source

Default binding opens the default browser (new activity). I assume that you are passing getBaseContext() as a context in a TextView(Context context) . You must pass the action as the default context. If you are worried about a memory leak, you can try getApplicationContext() , but have not tested it.

The best way to handle this is to create a listener in a TextView running on the onclick() range. Your activity (the one that created textView () catches this listener, and then the action opens the browser. Here you can see how to make your own listener

Another way to do this is to implement a WebView in your layout, and all you have to do from textView is to show that the webView with the link clicked. getBaseContext () can do this.

0
source

All Articles