FileDocCategorySizeDatePackage
ActivityMain.javaAPI DocAndroid 5.1 API1804Thu Mar 12 22:22:44 GMT 2015com.google.android.test.lib_client

ActivityMain

public class ActivityMain extends android.app.Activity

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String[] expectedAnimals = new String[] {
                "Racoon",
                "Rhino",
                "Elephant"
        };

        String[] animals = getResources().getStringArray(com.google.android.test.shared_library.R.array.animals);
        if (animals == null || animals.length != expectedAnimals.length) {
            throw new AssertionError("Animal list from shared library is null or wrong length.");
        }

        for (int i = 0; i < expectedAnimals.length; i++) {
            if (!expectedAnimals[i].equals(animals[i])) {
                throw new AssertionError("Expected '" + expectedAnimals[i]
                        + "' at index " + i + " but got '" + animals[i]);
            }
        }

        SharedLibraryMain.ensureVersion(this, SharedLibraryMain.VERSION_BASE);