1package com.android.test.hwui;
2
3import android.app.Activity;
4import android.os.Bundle;
5import android.util.Log;
6import android.view.View;
7import android.view.ViewGroup;
8
9public class ZOrderingActivity extends Activity {
10    @Override
11    protected void onCreate(Bundle savedInstanceState) {
12        super.onCreate(savedInstanceState);
13        setContentView(R.layout.z_ordering);
14
15        ViewGroup grandParent = (ViewGroup) findViewById(R.id.parent);
16        if (grandParent == null) throw new IllegalStateException();
17        View.OnClickListener l = new View.OnClickListener() {
18            @Override
19            public void onClick(View v) {}
20        };
21        for (int i = 0; i < grandParent.getChildCount(); i++) {
22            ViewGroup parent = (ViewGroup) grandParent.getChildAt(i);
23            for (int j = 0; j < parent.getChildCount(); j++) {
24                parent.getChildAt(j).setOnClickListener(l);
25            }
26        }
27    }
28}
29