Java tutorial
//package com.java2s; public class Main { public static String getIdNameFromId(String pId) { if (pId.startsWith("@+id/")) { return pId.substring(5); } else if (pId.startsWith("@id/")) { return pId.substring(4); } throw new IllegalArgumentException("Wrong id structure: " + pId); } }