Obviously, given just that code, it's impossible to know to what's wrong, but initialized checkedItems in getView() looks very incorrect to me.
On Aug 26, 3:48 pm, RobinDroid <[email protected]> wrote: > Dear All, > I have problem on unchecking the checkbox when a menu is fired.? > I am using a baseAdapter where i have a getView() method as such: > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > public View getView(final int position, View view, ViewGroup parent) { > final ViewHolder viewHolder; > if (view == null) { > viewHolder = new ViewHolder(); > view = layoutInfalter.inflate(R.layout.inbox_row, > null); > viewHolder.checkBox = (CheckBox) > view .findViewById(R.id.inboxCheckId); > if (INBOX_VIEW_MODE == -1) { > viewHolder.checkBox.setVisibility(View.GONE); > } else { > InboxEmailAdapter.setInboxViewMode(1); > > viewHolder.checkBox.setVisibility(View.VISIBLE); > checkedItems = new ArrayList<Integer>(); > > viewHolder.checkBox.setOnCheckedChangeListener(new > OnCheckedChangeListener() { > > @Override > public void > onCheckedChanged(CompoundButton buttonView, boolean > isChecked) { > if(isChecked){ > > viewHolder.checkBox.setId(inboxEmailList.get(position).getId()); > > checkedItems.add(viewHolder.checkBox.getId()); > } > > } > }); > } > viewHolder.emailFrom = (TextView) > view.findViewById(R.id.inboxFrom); > viewHolder.emailSubject = (TextView) > view.findViewById(R.id.inboxSubject); > view.setTag(viewHolder); > > } else { > viewHolder = (ViewHolder) view.getTag(); > } > > viewHolder.emailFrom.setText(inboxEmailList.get(position).getFrom()); > > viewHolder.emailSubject.setText(inboxEmailList.get(position).getSubject()); > > return view; > } > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > On my activity: > > I have a listView populated with checkbox? > I select checkbox, it is being selected. > On my Menu i have cancel button which on click should uncheck the > selected checkbox? > I am not being able to perform this? > > Any helps would really help me -- 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

