Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.net.Uri;

import java.util.List;

public class Main {
    private static long extractLong(Uri uri, int index) {
        return Long.valueOf(extract(uri, index));
    }

    private static String extract(Uri uri, int index) {
        List<String> pathSegments = uri.getPathSegments();
        if (pathSegments.isEmpty() || pathSegments.size() < index)
            return null;
        return pathSegments.get(index);
    }
}