get All TextView - Android User Interface

Android examples for User Interface:TextView

Description

get All TextView

Demo Code


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

import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;

public class Main {
  public static List<TextView> getAllTextView(List<View> views) {
    List<TextView> allTextViewList = new ArrayList<TextView>();
    for (View view : views) {
      if (view instanceof CheckBox) {
      } else if (view instanceof TextView) {
        allTextViewList.add((TextView) view);
      }// w  ww  . j ava  2s.  c  o m
    }
    return allTextViewList;
  }
}

Related Tutorials