Java tutorial
//package com.java2s; import android.net.Uri; import java.util.List; public class Main { /** * get the path segments * @param url * @return */ public static List<String> getPathSegments(String url) { return Uri.parse(url).getPathSegments(); } }