*am making a list by this code>>>>>*
public class myList extends ListActivity{
private static EfficientAdapter efficientAdapter;
private static class EfficientAdapter extends BaseAdapter {
static Bitmap bmp[] = new Bitmap[3];
private LayoutInflater mInflater;
public EfficientAdapter(Context context) {
mInflater = LayoutInflater.from(context);
bmp[1] = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon1);
bmp[2] = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon2);
bmp[3] =
BitmapFactory.decodeResource(context.getResources(),R.drawable.icon3);
}
public int getCount() {
return DATA.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
iew(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.mainscreen, null);
holder = new ViewHolder();
holder.text = (TextView)
convertView.findViewById(R.id.label);
holder.icon = (ImageView)
convertView.findViewById(R.id.icon);
holder.text.setGravity(Gravity.CENTER_VERTICAL);
holder.text.setHeight(64);
holder.icon.setMinimumHeight(64);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.text.setText(DATA[position]);
holder.icon.setImageBitmap((bmp[position]));
return convertView;
}
static class ViewHolder {
TextView text;
ImageView icon;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
efficientAdapter = new EfficientAdapter(this);
setListAdapter(efficientAdapter);
*
and want to add a text view on the top of list...but it should not be the
list item*
--
A N K ! T......
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en