get View List By Tag - Android User Interface

Android examples for User Interface:View Tag

Description

get View List By Tag

Demo Code

import java.util.ArrayList;
import java.util.List;

import android.view.View;

public class Main {
  public static List<View> getViewListByTag(List<View> viewList, String tag) {
    List<View> tagViewList = new ArrayList<View>();
    for (View view : viewList) {
      if (view.getTag() != null && view.getTag().equals(tag)) {
        tagViewList.add(view);//from  w  w w  .j  a v a2 s. c  o m
      }
    }
    return tagViewList;
  }
}

Related Tutorials