Android examples for User Interface:ImageView
Set Icon to ImageView by icon id and view id
//package com.java2s; import android.view.View; import android.widget.ImageView; public class Main { public static Boolean SetIconId(View parentView, int nViewId, int nIconId) { ImageView imageView = (ImageView) parentView.findViewById(nViewId); if (imageView == null) { return false; }//from w w w .j a va 2 s .com imageView.setImageResource(nIconId); return true; } }