Android examples for User Interface:View Parent
index Of View In Parent
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static int indexOfViewInParent(View view, ViewGroup parent) { int index; for (index = 0; index < parent.getChildCount(); index++) { if (parent.getChildAt(index) == view) break; }//from ww w . j a v a2 s .co m return index; } }