Here you can find the source of getname(Context mContext, View v)
public static String getname(Context mContext, View v)
//package com.java2s; import android.content.Context; import android.view.View; public class Main { public static String getname(Context mContext, View v) { try {//from ww w. ja va2 s . com String name = mContext.getResources() .getResourceName(v.getId()); return name; } catch (Exception ex) { return ""; } } private static int getId(String wig_name, Context context) { int id = context.getResources().getIdentifier(wig_name, null, null); return id; } }