| 02 |      * @note 获取该activity所有view | 
     | 05 |     publicList<View> getAllChildViews() { | 
   | 06 |         View view = this.getWindow().getDecorView(); | 
   | 07 |         returngetAllChildViews(view); | 
     | 10 |     privateList<View> getAllChildViews(View view) { | 
   | 11 |         List<View> allchildren = newArrayList<View>(); | 
   | 12 |         if(view instanceofViewGroup) { | 
   | 13 |             ViewGroup vp = (ViewGroup) view; | 
   | 14 |             for(inti = 0; i < vp.getChildCount(); i++) { | 
   | 15 |                 View viewchild = vp.getChildAt(i); | 
   | 16 |                 allchildren.add(viewchild); | 
   | 17 |                 allchildren.addAll(getAllChildViews(viewchild)); | 
     
  
转载于:https://www.cnblogs.com/zhengbeibei/archive/2013/03/16/2963446.html