public String[] resnames() {
        List<String> names = new ArrayList<String>();
        ResDrawable dw = getattr(ResDrawable.class);
        Resource res;
        if (dw != null) {
            res = dw.res.get();
            if (res != null) {
                names.add(res.name);
            }
        } else {
            Layered ld = getattr(Layered.class);
            if (ld != null) {
                for (Indir<Resource> ir : ld.layers) {
                    res = ir.get();
                    if (res != null) {
                        names.add(res.name);
                    }
                }
            }
        }
        return names.toArray(new String[names.size()]);
    }