Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.content.res.TypedArray;

import android.support.annotation.ArrayRes;

public class Main {
    /**
     */
    public static int[] getDrawableIdsArray(Context context, @ArrayRes int drawableArraysId) {
        TypedArray ta = context.getResources().obtainTypedArray(drawableArraysId);
        int count = ta.length();
        int[] ids = new int[count];
        for (int i = 0; i < count; i++) {
            ids[i] = ta.getResourceId(i, 0);
        }
        ta.recycle();
        return ids;
    }
}