find View By Id - Android User Interface

Android examples for User Interface:View Find

Description

find View By Id

Demo Code


//package com.java2s;
import android.app.Activity;

import android.view.View;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T extends View> T findViewById(Activity activity,
            int id, T... type) {
        return (T) activity.findViewById(id);
    }//from   ww  w.  ja v a2s  .co m
}

Related Tutorials