[Solved] Translate Objective-C code to recognize links to Java for Android [closed]


This may work:

import java.net.URL;
import java.util.List;

String input = /* text from edit text */;

String[] words = input.split("\\s");
List<URL> urls;

for (String s : words)
{
    try 
    {
        urls.add(new URL(s));
    }
    catch (MalformedURLException e)
    {
        // not a url
    }
}

// urls contains all urls from 'input'.

1

solved Translate Objective-C code to recognize links to Java for Android [closed]