Dynamic Linkify Text In Listview - Error : No Intent Found With Data : Specified Url
Solution 1:
Look like you need to put http://
at the beginning of that URL. Without the protocol specifier Android appears to assume "content://" is the intended url type.
Solution 2:
Linkify by default opens the default browser (new activity). I'm guessing you pass getBaseContext()
as context to the TextView(Context context)
. You have to pass the activity as Context for that to work by default. If you are concerned about memory leaks you can try getApplicationContext()
but haven't tested it.
The best way to handle that is to create a listener at the TextView fired on onclick()
of the span . Your activity (the one that created the textView() catches that listener and then the activity opens the browser. Here you can see how to make your own listener
Another way to do that is to implement a WebView in you layout and all you have to do from the textView is to show that webView with the link clicked. getBaseContext() can do that.
Post a Comment for "Dynamic Linkify Text In Listview - Error : No Intent Found With Data : Specified Url"