Package 

Class ResUtils


  • 
    public class ResUtils
    
                        

    Utilities for translating the normal output of ZoneInfoCompiler/ ZoneInfoProvider into the raw resources for Android

    • Method Summary

      Modifier and Type Method Description
      static String getTzResource(String tzFile) Returns a resource name equivalent for a TZ ID
      static String getZoneInfoMapResource()
      static int getIdentifier(Class<out Object> type, String name) Retrieves a resource id dynamically, via reflection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getTzResource

         static String getTzResource(String tzFile)

        Returns a resource name equivalent for a TZ ID

        Parameters:
        tzFile - the ID of the TZ, or a special filename (e.g.
      • getIdentifier

         static int getIdentifier(Class<out Object> type, String name)

        Retrieves a resource id dynamically, via reflection. It's much fasterthan Resources.getIdentifier(), however it only allows you to getidentifiers from your own package. Note that this method is still slower than retrieving resourcesdirectly (e.g., R.drawable.MyResource) - it should only be usedwhen dynamically retrieving ids.Originally sourced from https://github.com/dlew/android-utils/

        Parameters:
        type - the type of resource (e.g.
        name - the name of the resource