get resource Style ID - Android App

Android examples for App:Resource

Description

get resource Style ID

Demo Code


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

public class Main {
    public static int getStyleID(Context context, String key) {
        return context.getResources().getIdentifier(key, "style",
                context.getPackageName());
    }//from ww  w  . ja v  a  2 s.c  om
}

Related Tutorials