public void setData(JSONObject item, int position) { ImageView icon = (ImageView) findViewById(R.id.icon); Conts.getView(this, R.id.left).setVisibility(View.GONE); // icon.setBackgroundResource(R.drawable.new_home_dv_bg_1); icon.setImageResource(R.drawable.tranfer); Conts.setTextView(findViewById(R.id.name), ""); String service_icon = Conts.getString(item, DichVuStore.service_icon); Conts.showLogoDichvu(icon, service_icon); try { Conts.setTextView(findViewById(R.id.name), item, DichVuStore.service_name); } catch (Exception exception) { } Conts.getView(this, R.id.left).setVisibility(position == 0 ? View.VISIBLE : View.GONE); }
public void setData(Cursor cursor) { ImageView home_item_img_icon = (ImageView) findViewById(R.id.icon); Conts.getView(this, R.id.left).setVisibility(View.GONE); home_item_img_icon.setBackgroundResource(R.drawable.new_home_dv_bg_1); home_item_img_icon.setImageResource(R.drawable.tranfer); Conts.setTextView(findViewById(R.id.name), ""); if (cursor != null) { String service_icon = cursor.getString(cursor.getColumnIndex(DichVuStore.service_icon)) + ""; Conts.showLogoDichvu(home_item_img_icon, service_icon); try { Conts.setTextViewCursor(findViewById(R.id.name), cursor, DichVuStore.service_name); } catch (Exception exception) { } int poistion = cursor.getPosition(); Conts.getView(this, R.id.left).setVisibility(poistion == 0 ? View.VISIBLE : View.GONE); } }