Question

I am trying to capture the click on my listview, which contains a checkedtextview my code is as follows

listview.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) 
        { 
            CheckedTextView Item_Check = (CheckedTextView) view;
            if (Item_Check.isChecked())
            {
//code to handle the when item is turned off 
//i.e. previous state was checked and presently its being unchecked
            }
            else 
            {
            }

This works well in ICS, however in Jellybean I am experiencing the straight opposite, i.e. when the button is turned on my turn off code is being executed and the other way around.

Is there any change in Jellybean that is causing this, I mean by way of when the setOnItemClickListener is being called or is it a wrong approach that I am taking.

Was it helpful?

Solution

This is actually a known Android bug as can be seen here: https://code.google.com/p/android/issues/detail?id=35885

I just stumbled upon this same problem and I am currently trying to find a good and simple workaround for it. As soon as I have something, I'll post it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top