public static String removeUriFragment(String url){
  if (url == null || url.length() == 0) {
    return null;
  }
  String[] arr=url.split("#");
  if (arr.length == 2) {
    return arr[0];
  }
 else {
    return url;
  }
}

public static String removeUriFragment ( String url ) { if ( url == null || url . length ( ) == 0 ) { return null ; } String [ ] arr = url . split ( "#" ) ; if ( arr . length == 2 ) { return arr [ 0 ] ; } else { return url ; } }
gets the uri without the fragment . for e . g if the uri is content : / / com . android . storage / data / images / 48829 # is_png the part after ' # ' is called as fragment . this method strips the fragment and returns the url .
