Index
,Gainers
,Losers
are the 3 buttons
。
On each button
click, listView
gets populated with corresponding data。
第3栏:编码 可查阅
基于<代码>%Chg数值,对应的<代码> 页: 1 意见条码>后附<>%Chg。
updown
至
Adapter
。 班级
Based on that value, Adapter
should set the down arrow
or up arrow
www。un。org/Depts/DGACM/index_spanish。htm 适应性班(植物学)法
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
LayoutInflater inflater = activity。getLayoutInflater();
if (convertView == null) {
convertView = inflater。inflate(R。layout。list_table, null);
holder = new ViewHolder();
holder。txtFirst = (TextView) convertView
。findViewById(R。id。FirstText);
holder。txtSecond = (TextView) convertView
。findViewById(R。id。SecondText);
holder。txtThird = (TextView) convertView
。findViewById(R。id。ThirdText);
holder。ivarrow = (ImageView) convertView。findViewById(R。id。ivarrow);
holder。l1 = (LinearLayout) convertView
。findViewById(R。id。tableLayout);
convertView。setTag(holder);
} else {
holder = (ViewHolder) convertView。getTag();
}
HashMap<String, String> map = list。get(position);
//Setting the row background
if (count % 2 == 0) {
try {
InputStream is1 = ctx。getAssets()。open("cellbg。png");
Drawable d1 = Drawable。createFromStream(is1, "cellbg");
holder。l1。setBackgroundDrawable(d1);
} catch (Exception e) {
throw new Error(" exception in TableListAdapter "
+ e。getMessage());
}
} else {
try {
InputStream is2 = ctx。getAssets()。open("cellbg1。png");
Drawable d2 = Drawable。createFromStream(is2, "cellbg1");
holder。l1。setBackgroundDrawable(d2);
} catch (Exception e) {
throw new Error(" exception in TableListAdapter "
+ e。getMessage());
}
}
count++;
//setting the arrow
if (i < updown。length) {
if (updown[i] > 0) {
holder。ivarrow。setImageResource(R。drawable。up);
Log。v("up", "up");
} else {
holder。ivarrow。setImageResource(R。drawable。down);
Log。v("down", "down");
}
Log。v("i=", i + " ,updown=" + updown[i]);
i++;
}
holder。txtFirst。setText(map。get(FIRST_COLUMN));
holder。txtSecond。setText(map。get(SECOND_COLUMN));
holder。txtThird。setText(map。get(THIRD_COLUMN));
return convertView;
}
。
Log is showing correct data but arrow is getting displayed in only 1st row。 i。e。 if Last value of list is positive
, it shows up arrow
to 1st row and if Last value of list is negative
, it shows down arrow
to 1st row。。。
www.un.org/Depts/DGACM/index_spanish.htm 如何向每一行展示相应的arrow?
I m new to android development。 So ANY HELP WILL BE LIFE-SAVER !!! 。