Android View Get getname(Context mContext, View v)

Here you can find the source of getname(Context mContext, View v)

Description

getname

Declaration

public static String getname(Context mContext, View v) 

Method Source Code

//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;
    }
}

Related

  1. changeViewState(View view, MotionEvent event)
  2. findInParents(View view, Class parentClass)
  3. findUsingTag(View v, int resourceId)
  4. getRandomView(int size)
  5. forceChildrenInvalidateRecursively(View view)