I have this piece of code:
TextView noteView = (TextView) view.findViewById(R.id.content);
noteView.setMovementMethod(LinkMovementMethod.getInstance());
noteView.setText(Html.fromHtml(noteView.getText().toString()));
I need to open links in a webview, not in a browser... is this possible?? how can I do??
Thanks in advance..
Yes, you can do that, it's pretty simple task with WebView, you need to declare a WebViewClient object and override the
public boolean shouldOverrideUrlLoading (WebView view, String url)
method, there you can filter urls or give some customized functionality.In your case, to stay on the WebView, you would need to return false on that method.
Check out this tutorial.
Regards
EDITED:
It seems your question is how to handle the click event on the TextView's url. As it's suggested on this question you can filter the
ACTION_VIEW
intent on your WebView containing Activity. If you need more guidance about intent-filters, check this out.additional, you can do this.