获取类名和控件id
//这样可以拿到id System.out.println(v.getResources().getResourceName(v.getId())); //这样可以拿到activity名字 Context context = v.getContext(); if(context instanceof Activity) { Activity activity = (Activity)context; System.out.println(activity.getLocalClassName()); }
R文件里面其实就这么多数据