private String extractUrl(String sharedUrl){
  String finalUrl;
  finalUrl=sharedUrl.trim();
  String[] possible_urls=finalUrl.split(" ");
  for (  String url : possible_urls) {
    if (NetworkManager.isUrl(url)) {
      finalUrl=url;
      break;
    }
  }
  finalUrl=finalUrl.substring(finalUrl.lastIndexOf(" ") + 1);
  finalUrl=finalUrl.substring(finalUrl.lastIndexOf("\n") + 1);
  if (NetworkManager.isUrl("http://" + finalUrl) && !NetworkManager.isUrl(finalUrl)) {
    finalUrl="http://" + finalUrl;
  }
  if (finalUrl.contains("&utm_source=")) {
    finalUrl=finalUrl.substring(0,finalUrl.indexOf("&utm_source="));
  }
  if (finalUrl.contains("?utm_source=")) {
    finalUrl=finalUrl.substring(0,finalUrl.indexOf("?utm_source="));
  }
  if (finalUrl.contains("#xtor=RSS-")) {
    finalUrl=finalUrl.substring(0,finalUrl.indexOf("#xtor=RSS-"));
  }
  return finalUrl;
}

private String extractUrl ( String sharedUrl ) { String finalUrl ; finalUrl = sharedUrl . trim ( ) ; String [ ] possible_urls = finalUrl . split ( " " ) ; for ( String url : possible_urls ) { if ( NetworkManager . isUrl ( url ) ) { finalUrl = url ; break ; } } finalUrl = finalUrl . substring ( finalUrl . lastIndexOf ( " " ) + 1 ) ; finalUrl = finalUrl . substring ( finalUrl . lastIndexOf ( "\n" ) + 1 ) ; if ( NetworkManager . isUrl ( "http://" + finalUrl ) && ! NetworkManager . isUrl ( finalUrl ) ) { finalUrl = "http://" + finalUrl ; } if ( finalUrl . contains ( "&utm_source=" ) ) { finalUrl = finalUrl . substring ( 0 , finalUrl . indexOf ( "&utm_source=" ) ) ; } if ( finalUrl . contains ( "?utm_source=" ) ) { finalUrl = finalUrl . substring ( 0 , finalUrl . indexOf ( "?utm_source=" ) ) ; } if ( finalUrl . contains ( "#xtor=RSS-" ) ) { finalUrl = finalUrl . substring ( 0 , finalUrl . indexOf ( "#xtor=RSS-" ) ) ; } return finalUrl ; }
method to extract the url from shared data and delete trackers
