mehdidanesh
سه شنبه 06 آبان 1393, 10:03 صبح
با سلام
یک لیست ویو دارم. زمانی که کلیک می کنم روش وارد یک activity دیگه می شه و اونجا می تونی موضوع رو به لیست علاقه مندی ها اضافه کنی این قطعه کد و براش نوشتم:
کد:
public View getView(int arg0, View arg1, ViewGroup arg2) {
ViewHolder Holder;
if (arg1 == null) {
arg1 = myInflater.inflate(R.layout.row_list, null);
Holder = new ViewHolder();
Holder.tvid = (TextView) arg1.findViewById(R.id.tv2);
Holder.tvtitle = (TextView) arg1.findViewById(R.id.tvdaym);
Holder.like_ac = (ImageView) arg1.findViewById(R.id.Like2);
arg1.setTag(Holder);
}
else
Holder = (ViewHolder) arg1.getTag();
Holder.tvid.setText(contacts.get(arg0).getID());
Holder.tvtitle.setText(contacts.get(arg0).getQ());
if ((contacts.get(arg0).getLike()).equalsIgnoreCase("1"))
Holder.like_ac.setVisibility(1);
else
Holder.like_ac.setImageResource(R.drawable.like);
return arg1;
}
مشکل من اینه که وقتی که روی آیکن مورد نظر کلیک میشه (علاقه مندی ها) به لیست ویو اعمال نمیشه و زمانی که بر می گردم به activity اون از حالت انتخاب در آمده است!
لطفا راهنمایی ام کنید
ممنون از همه
یک لیست ویو دارم. زمانی که کلیک می کنم روش وارد یک activity دیگه می شه و اونجا می تونی موضوع رو به لیست علاقه مندی ها اضافه کنی این قطعه کد و براش نوشتم:
کد:
public View getView(int arg0, View arg1, ViewGroup arg2) {
ViewHolder Holder;
if (arg1 == null) {
arg1 = myInflater.inflate(R.layout.row_list, null);
Holder = new ViewHolder();
Holder.tvid = (TextView) arg1.findViewById(R.id.tv2);
Holder.tvtitle = (TextView) arg1.findViewById(R.id.tvdaym);
Holder.like_ac = (ImageView) arg1.findViewById(R.id.Like2);
arg1.setTag(Holder);
}
else
Holder = (ViewHolder) arg1.getTag();
Holder.tvid.setText(contacts.get(arg0).getID());
Holder.tvtitle.setText(contacts.get(arg0).getQ());
if ((contacts.get(arg0).getLike()).equalsIgnoreCase("1"))
Holder.like_ac.setVisibility(1);
else
Holder.like_ac.setImageResource(R.drawable.like);
return arg1;
}
مشکل من اینه که وقتی که روی آیکن مورد نظر کلیک میشه (علاقه مندی ها) به لیست ویو اعمال نمیشه و زمانی که بر می گردم به activity اون از حالت انتخاب در آمده است!
لطفا راهنمایی ام کنید
ممنون از همه