Hi,
I'm writing a test app which have a operation of click on the
CheckBoxPreference, here is my code:

public class MyActivityTest extends
ActivityInstrumentationTestCase2<MyActivity>{
.....
@UiThreadTest
        public void testEnable() {
                CheckBoxPreference mMyEnable =
(CheckBoxPreference)mActivity.getPreferenceScreen().findPreference("my_enabled");
                mMyEnable.setChecked(false);
                Log.v(TAG,
"=======================1=============isChecked:"+mMyEnable.isChecked());
                mMyEnable.setChecked(false);
                Log.v(TAG,
"=======================2=============isChecked:"+mMyEnable.isChecked());
                        wait(4);
        }
....
}

in logcat, the isChecked value actually changed:
V/MyAppTest(12589):
=======================2=============isChecked:true
V/MyAppTest(12589):
=======================2=============isChecked:false

However on GUI, this checkbox not be clicked/unclicked... is there
anyone have some ideas?
Many thanks

Regards
Ira

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to