Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.res.Resources;
import android.view.View;

public class Main {
    public static String getResourceId(View v) {
        // http://stackoverflow.com/a/17583380/198348
        int id = v.getId();
        String idString = "no id";
        if (id != View.NO_ID) {
            Resources res = v.getResources();
            if (res != null)
                idString = res.getResourceEntryName(id);
        }
        return idString;
    }
}