public static String extractFromResourceId ( String id , String identifier ) { if ( id == null || identifier == null ) { return id ; } Pattern pattern = Pattern . compile ( identifier + "/[-\\w._]+" ) ; Matcher matcher = pattern . matcher ( id ) ; if ( matcher . find ( ) ) { return matcher . group ( ) . split ( "/" ) [ 1 ] ; } else { return null ; } }
Extract information from a resource ID string with the resource type as the identifier .