I've seen both being used for getting the ID in a content provider.
String id = uri.getLastPathSegment();
String id = uri.getPathSegments().get(1);
Is there a difference? and if so, is one better / better practice than the other?
Or in which situation would you use one and not the other?