java - Android UIAutomator: setAsHorizontalList() throws noSuchMethodError -


i'm running android version 4.1.2 on samsung galaxy sii. i've started working uiautomator test user interface. problem everytime try run test on phone nosuchmethoderror on method setashorizontallist() used on uiscrollable object. eclipse recognize method , doesn't give compile error.

    private void turnoffnetwork() throws uiobjectnotfoundexception {         getuidevice().presshome();          uiobject allappsbutton = new uiobject(new uiselector().description("apps"));         allappsbutton.clickandwaitfornewwindow();         uiobject appstab = new uiobject(new uiselector().text("apps"));         appstab.click();         uiscrollable appviews = new uiscrollable(new uiselector().scrollable(true));         appviews.setashorizontallist();         uiobject settingsapp = appviews.getchildbytext(new uiselector().classname(android.widget.textview.class.getname()), "instellingen");          settingsapp.clickandwaitfornewwindow();          uiobject switchobject = new uiobject(new uiselector().classname(android.widget.switch.class.getname()));          if (switchobject.ischecked()) {             switchobject.click();         }     } 

unfortunately, setashorizontallist() function can work on 4.2.2 (api 17) device, not on api 16, can try on emulator or tablet api 17. learnt hard way few days ago


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -