Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.content.res.TypedArray;

public class Main {
    public static int[] getIdsArray(Context context, int idArray) {
        TypedArray ar = context.getResources().obtainTypedArray(idArray);
        int len = ar.length();
        int[] arrayIds = new int[len];
        for (int i = 0; i < len; i++)
            arrayIds[i] = ar.getResourceId(i, 0);
        ar.recycle();
        return arrayIds;
    }
}