问题
Is the isChecked()
method Deprecated?
I am coding for android UI and using UiAutomator Framework there this mathod is not displayed
I am trying to validate one uiobject
through isChecked()
whether it is clicked or not.
from the below link i came to know it is Deprecated and now we should use getValue()
.
http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/CheckBox.html
Code:
UiObject object = new UiObject(new UiSelector().text("Airplane mode"));
if(object!=null) {
if(!object.isChecked())
object.click();
}
Here the problem is that the getValue
method is not displaying i.e notavaible for use for me and isChecked()
is always returning false
to me.
Can any one give any suggestion to me.
回答1:
I guess you are referring to a wrong documentation.
Please check this Link for UIObject class documentation.
I don't think isChecked()
is deprecated. It can be used only on an UI Object who's node detail 'checkable'=>true
回答2:
I have similar problem except android studio wont even accept the method. I'm using a CheckedTextView and when I try to put
myCheckedTextView.isChecked()
android studio tells me "cannot resolve method isChecked()" but has plenty of other suggestions as expected.
suspiciously isChecked() is the only method in the documentation that has no description besides the signature. http://developer.android.com/reference/android/widget/CheckedTextView.html#isChecked()
来源:https://stackoverflow.com/questions/24571244/is-the-ischecked-method-deprecated