find ListView By Item View - Android User Interface

Android examples for User Interface:ListView

Description

find ListView By Item View

Demo Code


//package com.java2s;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

public class Main {
    public static View findListViewByItemView(View view) {
        if (view == null || view.getParent() instanceof ListView) {
            return view;
        } else {/* www  . j  a v a2 s . c o m*/
            Log.i("---", "---" + view);
            return findListViewByItemView((ViewGroup) view.getParent());
        }
    }
}

Related Tutorials