FileDocCategorySizeDatePackage
InstrumentationUtils.javaAPI DocAndroid 1.5 API1571Wed May 06 22:42:02 BST 2009android.test

InstrumentationUtils

public class InstrumentationUtils extends Object
The InstrumentationUtils class has all the utility functions needed for instrumentation tests. {@hide} - Not currently used.

Fields Summary
Constructors Summary
Methods Summary
public static intgetMenuIdentifier(java.lang.Class cls, java.lang.String identifier)
An utility function that returns the menu identifier for a particular menu item.

param
cls Class object of the class that handles the menu ite,.
param
identifier Menu identifier.
return
The integer corresponding to the menu item.

        int id = -1;
        try {
            Integer field = (Integer)cls.getDeclaredField(identifier).get(cls);   
            id = field.intValue();
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return id;