-1

I know there's a lot about this but I want to make the whole webview not clickable so that it's like you press somewhere on a picture...

Is there a solution?

Jan Knoblauch
  • 219
  • 1
  • 3
  • 20
  • I think this topic will help http://stackoverflow.com/questions/5116909/how-i-can-get-onclick-event-on-webview-in-android – azerto00 Nov 13 '13 at 12:58
  • no, that's not what I'm searching about because with this code, I am able to click on the link. Yes, the link will not be opened, but I'm still able to click on it. That's it what I don't want to. – Jan Knoblauch Nov 13 '13 at 15:57

1 Answers1

2

Ok, So, Maybe there is a solution.

  • 1 : Retrieve as a String the content that will be display
  • 2 : Find all links (with REGEXP) and replace by the content

I'm not expert in REGEXP, but the

<a href="http://www.the-link" alt="ddsd">BLABLA</a>

has to become

BLABLA

I think this is possible

EDIT

Try with this function

private String RemoveUrl(String commentstr)
{
    String commentstr1=commentstr;
    String urlPattern = "((https?|ftp|gopher|telnet|file|Unsure|http):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)";
    Pattern p = Pattern.compile(urlPattern,Pattern.CASE_INSENSITIVE);
    Matcher m = p.matcher(commentstr1);
    int i=0;
    while (m.find()) {
        commentstr1=commentstr1.replaceAll(m.group(i),"").trim();
        i++;
    }
    return commentstr1;
}

source : Removing the url from text using java

Community
  • 1
  • 1
azerto00
  • 1,001
  • 6
  • 18