1 page.title=UiSelector 2 parent.title=uiautomator 3 parent.link=index.html 4 @jd:body 5 <style> 6 h4.jd-details-title {background-color: #DEE8F1;} 7 </style> 8 <p>Specifies the elements in the layout hierarchy for tests to target, filtered 9 by properties such as text value, content-description, class name, and state 10 information. You can also target an element by its location in a layout 11 hierarchy.</p> 12 <h2>Summary</h2> 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 <!-- ======== CONSTRUCTOR SUMMARY ======== --> 37 <table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> 38 39 40 41 42 <tr class="api" > 43 <td class="jd-typecol"><nobr> 44 45 46 47 48 49 </nobr> 50 </td> 51 <td class="jd-linkcol" width="100%"><nobr> 52 <span class="sympad"><a href="#UiSelector()">UiSelector</a></span>()</nobr> 53 54 </td></tr> 55 56 57 58 </table> 59 60 61 62 63 64 65 <!-- ========== METHOD SUMMARY =========== --> 66 <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> 67 68 69 70 71 <tr class="api" > 72 <td class="jd-typecol"><nobr> 73 74 75 76 77 78 <a href="#">UiSelector</a></nobr> 79 </td> 80 <td class="jd-linkcol" width="100%"><nobr> 81 <span class="sympad"><a href="#checkable(boolean)">checkable</a></span>(boolean val)</nobr> 82 83 <div class="jd-descrdiv">Set the search criteria to match widgets that are checkable.</div> 84 85 </td></tr> 86 87 88 89 <tr class="api" > 90 <td class="jd-typecol"><nobr> 91 92 93 94 95 96 <a href="#">UiSelector</a></nobr> 97 </td> 98 <td class="jd-linkcol" width="100%"><nobr> 99 <span class="sympad"><a href="#checked(boolean)">checked</a></span>(boolean val)</nobr> 100 101 <div class="jd-descrdiv">Set the search criteria to match widgets that 102 are currently checked (usually for checkboxes).</div> 103 104 </td></tr> 105 106 107 108 <tr class="api" > 109 <td class="jd-typecol"><nobr> 110 111 112 113 114 115 <a href="#">UiSelector</a></nobr> 116 </td> 117 <td class="jd-linkcol" width="100%"><nobr> 118 <span class="sympad"><a href="#childSelector(com.android.uiautomator.core.UiSelector)">childSelector</a></span>(<a href="#">UiSelector</a> selector)</nobr> 119 120 <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector.</div> 121 122 </td></tr> 123 124 125 126 <tr class="api" > 127 <td class="jd-typecol"><nobr> 128 129 130 131 132 133 <a href="#">UiSelector</a></nobr> 134 </td> 135 <td class="jd-linkcol" width="100%"><nobr> 136 <span class="sympad"><a href="#className(java.lang.String)">className</a></span>(String className)</nobr> 137 138 <div class="jd-descrdiv">Set the search criteria to match the class property 139 for a widget (for example, "android.widget.Button").</div> 140 141 </td></tr> 142 143 144 145 <tr class="api" > 146 <td class="jd-typecol"><nobr> 147 148 149 150 151 <T> 152 <a href="#">UiSelector</a></nobr> 153 </td> 154 <td class="jd-linkcol" width="100%"><nobr> 155 <span class="sympad"><a href="#className(java.lang.Class<T>)">className</a></span>(Class<T> type)</nobr> 156 157 <div class="jd-descrdiv">Set the search criteria to match the class property 158 for a widget (for example, "android.widget.Button").</div> 159 160 </td></tr> 161 162 163 164 <tr class="api" > 165 <td class="jd-typecol"><nobr> 166 167 168 169 170 171 <a href="#">UiSelector</a></nobr> 172 </td> 173 <td class="jd-linkcol" width="100%"><nobr> 174 <span class="sympad"><a href="#classNameMatches(java.lang.String)">classNameMatches</a></span>(String regex)</nobr> 175 176 <div class="jd-descrdiv">Set the search criteria to match the class property 177 for a widget, using a regular expression.</div> 178 179 </td></tr> 180 181 182 183 <tr class="api" > 184 <td class="jd-typecol"><nobr> 185 186 187 188 189 190 <a href="#">UiSelector</a></nobr> 191 </td> 192 <td class="jd-linkcol" width="100%"><nobr> 193 <span class="sympad"><a href="#clickable(boolean)">clickable</a></span>(boolean val)</nobr> 194 195 <div class="jd-descrdiv">Set the search criteria to match widgets that are clickable.</div> 196 197 </td></tr> 198 199 200 201 <tr class="api" > 202 <td class="jd-typecol"><nobr> 203 204 205 206 207 208 <a href="#">UiSelector</a></nobr> 209 </td> 210 <td class="jd-linkcol" width="100%"><nobr> 211 <span class="sympad"><a href="#description(java.lang.String)">description</a></span>(String desc)</nobr> 212 213 <div class="jd-descrdiv">Set the search criteria to match the content-description 214 property for a widget.</div> 215 216 </td></tr> 217 218 219 220 <tr class="api" > 221 <td class="jd-typecol"><nobr> 222 223 224 225 226 227 <a href="#">UiSelector</a></nobr> 228 </td> 229 <td class="jd-linkcol" width="100%"><nobr> 230 <span class="sympad"><a href="#descriptionContains(java.lang.String)">descriptionContains</a></span>(String desc)</nobr> 231 232 <div class="jd-descrdiv">Set the search criteria to match the content-description 233 property for a widget.</div> 234 235 </td></tr> 236 237 238 239 <tr class="api" > 240 <td class="jd-typecol"><nobr> 241 242 243 244 245 246 <a href="#">UiSelector</a></nobr> 247 </td> 248 <td class="jd-linkcol" width="100%"><nobr> 249 <span class="sympad"><a href="#descriptionMatches(java.lang.String)">descriptionMatches</a></span>(String regex)</nobr> 250 251 <div class="jd-descrdiv">Set the search criteria to match the content-description 252 property for a widget.</div> 253 254 </td></tr> 255 256 257 258 <tr class="api" > 259 <td class="jd-typecol"><nobr> 260 261 262 263 264 265 <a href="#">UiSelector</a></nobr> 266 </td> 267 <td class="jd-linkcol" width="100%"><nobr> 268 <span class="sympad"><a href="#descriptionStartsWith(java.lang.String)">descriptionStartsWith</a></span>(String desc)</nobr> 269 270 <div class="jd-descrdiv">Set the search criteria to match the content-description 271 property for a widget.</div> 272 273 </td></tr> 274 275 276 277 <tr class="api" > 278 <td class="jd-typecol"><nobr> 279 280 281 282 283 284 <a href="#">UiSelector</a></nobr> 285 </td> 286 <td class="jd-linkcol" width="100%"><nobr> 287 <span class="sympad"><a href="#enabled(boolean)">enabled</a></span>(boolean val)</nobr> 288 289 <div class="jd-descrdiv">Set the search criteria to match widgets that are enabled.</div> 290 291 </td></tr> 292 293 294 295 <tr class="api" > 296 <td class="jd-typecol"><nobr> 297 298 299 300 301 302 <a href="#">UiSelector</a></nobr> 303 </td> 304 <td class="jd-linkcol" width="100%"><nobr> 305 <span class="sympad"><a href="#focusable(boolean)">focusable</a></span>(boolean val)</nobr> 306 307 <div class="jd-descrdiv">Set the search criteria to match widgets that are focusable.</div> 308 309 </td></tr> 310 311 312 313 <tr class="api" > 314 <td class="jd-typecol"><nobr> 315 316 317 318 319 320 <a href="#">UiSelector</a></nobr> 321 </td> 322 <td class="jd-linkcol" width="100%"><nobr> 323 <span class="sympad"><a href="#focused(boolean)">focused</a></span>(boolean val)</nobr> 324 325 <div class="jd-descrdiv">Set the search criteria to match widgets that have focus.</div> 326 327 </td></tr> 328 329 330 331 <tr class="api" > 332 <td class="jd-typecol"><nobr> 333 334 335 336 337 338 <a href="#">UiSelector</a></nobr> 339 </td> 340 <td class="jd-linkcol" width="100%"><nobr> 341 <span class="sympad"><a href="#fromParent(com.android.uiautomator.core.UiSelector)">fromParent</a></span>(<a href="#">UiSelector</a> selector)</nobr> 342 343 <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector which is used to 344 start search from the parent widget.</div> 345 346 </td></tr> 347 348 349 350 <tr class="api" > 351 <td class="jd-typecol"><nobr> 352 353 354 355 356 357 <a href="#">UiSelector</a></nobr> 358 </td> 359 <td class="jd-linkcol" width="100%"><nobr> 360 <span class="sympad"><a href="#index(int)">index</a></span>(int index)</nobr> 361 362 <div class="jd-descrdiv">Set the search criteria to match the widget by its node 363 index in the layout hierarchy.</div> 364 365 </td></tr> 366 367 368 369 <tr class="api" > 370 <td class="jd-typecol"><nobr> 371 372 373 374 375 376 <a href="#">UiSelector</a></nobr> 377 </td> 378 <td class="jd-linkcol" width="100%"><nobr> 379 <span class="sympad"><a href="#instance(int)">instance</a></span>(int instance)</nobr> 380 381 <div class="jd-descrdiv">Set the search criteria to match the 382 widget by its instance number.</div> 383 384 </td></tr> 385 386 387 388 <tr class="api" > 389 <td class="jd-typecol"><nobr> 390 391 392 393 394 395 <a href="#">UiSelector</a></nobr> 396 </td> 397 <td class="jd-linkcol" width="100%"><nobr> 398 <span class="sympad"><a href="#longClickable(boolean)">longClickable</a></span>(boolean val)</nobr> 399 400 <div class="jd-descrdiv">Set the search criteria to match widgets that are long-clickable.</div> 401 402 </td></tr> 403 404 405 406 <tr class="api" > 407 <td class="jd-typecol"><nobr> 408 409 410 411 412 413 <a href="#">UiSelector</a></nobr> 414 </td> 415 <td class="jd-linkcol" width="100%"><nobr> 416 <span class="sympad"><a href="#packageName(java.lang.String)">packageName</a></span>(String name)</nobr> 417 418 <div class="jd-descrdiv">Set the search criteria to match the package name 419 of the application that contains the widget.</div> 420 421 </td></tr> 422 423 424 425 <tr class="api" > 426 <td class="jd-typecol"><nobr> 427 428 429 430 431 432 <a href="#">UiSelector</a></nobr> 433 </td> 434 <td class="jd-linkcol" width="100%"><nobr> 435 <span class="sympad"><a href="#packageNameMatches(java.lang.String)">packageNameMatches</a></span>(String regex)</nobr> 436 437 <div class="jd-descrdiv">Set the search criteria to match the package name 438 of the application that contains the widget.</div> 439 440 </td></tr> 441 442 443 444 <tr class="api" > 445 <td class="jd-typecol"><nobr> 446 447 448 449 450 451 <a href="#">UiSelector</a></nobr> 452 </td> 453 <td class="jd-linkcol" width="100%"><nobr> 454 <span class="sympad"><a href="#resourceId(java.lang.String)">resourceId</a></span>(String id)</nobr> 455 456 <div class="jd-descrdiv">Set the search criteria to match the given resource ID.</div> 457 458 </td></tr> 459 460 461 462 <tr class="api" > 463 <td class="jd-typecol"><nobr> 464 465 466 467 468 469 <a href="#">UiSelector</a></nobr> 470 </td> 471 <td class="jd-linkcol" width="100%"><nobr> 472 <span class="sympad"><a href="#resourceIdMatches(java.lang.String)">resourceIdMatches</a></span>(String regex)</nobr> 473 474 <div class="jd-descrdiv">Set the search criteria to match the resource ID 475 of the widget, using a regular expression.http://blog.bettersoftwaretesting.com/</div> 476 477 </td></tr> 478 479 480 481 <tr class="api" > 482 <td class="jd-typecol"><nobr> 483 484 485 486 487 488 <a href="#">UiSelector</a></nobr> 489 </td> 490 <td class="jd-linkcol" width="100%"><nobr> 491 <span class="sympad"><a href="#scrollable(boolean)">scrollable</a></span>(boolean val)</nobr> 492 493 <div class="jd-descrdiv">Set the search criteria to match widgets that are scrollable.</div> 494 495 </td></tr> 496 497 498 499 <tr class="api" > 500 <td class="jd-typecol"><nobr> 501 502 503 504 505 506 <a href="#">UiSelector</a></nobr> 507 </td> 508 <td class="jd-linkcol" width="100%"><nobr> 509 <span class="sympad"><a href="#selected(boolean)">selected</a></span>(boolean val)</nobr> 510 511 <div class="jd-descrdiv">Set the search criteria to match widgets that 512 are currently selected.</div> 513 514 </td></tr> 515 516 517 518 <tr class="api" > 519 <td class="jd-typecol"><nobr> 520 521 522 523 524 525 <a href="#">UiSelector</a></nobr> 526 </td> 527 <td class="jd-linkcol" width="100%"><nobr> 528 <span class="sympad"><a href="#text(java.lang.String)">text</a></span>(String text)</nobr> 529 530 <div class="jd-descrdiv">Set the search criteria to match the visible text displayed 531 in a widget (for example, the text label to launch an app).</div> 532 533 </td></tr> 534 535 536 537 <tr class="api" > 538 <td class="jd-typecol"><nobr> 539 540 541 542 543 544 <a href="#">UiSelector</a></nobr> 545 </td> 546 <td class="jd-linkcol" width="100%"><nobr> 547 <span class="sympad"><a href="#textContains(java.lang.String)">textContains</a></span>(String text)</nobr> 548 549 <div class="jd-descrdiv">Set the search criteria to match the visible text in a widget 550 where the visible text must contain the string in your input argument.</div> 551 552 </td></tr> 553 554 555 556 <tr class="api" > 557 <td class="jd-typecol"><nobr> 558 559 560 561 562 563 <a href="#">UiSelector</a></nobr> 564 </td> 565 <td class="jd-linkcol" width="100%"><nobr> 566 <span class="sympad"><a href="#textMatches(java.lang.String)">textMatches</a></span>(String regex)</nobr> 567 568 <div class="jd-descrdiv">Set the search criteria to match the visible text displayed in a layout 569 element, using a regular expression.</div> 570 571 </td></tr> 572 573 574 575 <tr class="api" > 576 <td class="jd-typecol"><nobr> 577 578 579 580 581 582 <a href="#">UiSelector</a></nobr> 583 </td> 584 <td class="jd-linkcol" width="100%"><nobr> 585 <span class="sympad"><a href="#textStartsWith(java.lang.String)">textStartsWith</a></span>(String text)</nobr> 586 587 <div class="jd-descrdiv">Set the search criteria to match visible text in a widget that is 588 prefixed by the text parameter.</div> 589 590 </td></tr> 591 592 593 594 <tr class="api" > 595 <td class="jd-typecol"><nobr> 596 597 598 599 600 601 String</nobr> 602 </td> 603 <td class="jd-linkcol" width="100%"><nobr> 604 <span class="sympad"><a href="#toString()">toString</a></span>()</nobr> 605 606 </td></tr> 607 608 609 610 </table> 611 612 613 614 615 <!-- ========== METHOD SUMMARY =========== --> 616 <table id="promethods" class="jd-sumtable"><tr><th colspan="12">Protected Methods</th></tr> 617 618 619 620 621 <tr class="api" > 622 <td class="jd-typecol"><nobr> 623 624 625 626 627 628 <a href="#">UiSelector</a></nobr> 629 </td> 630 <td class="jd-linkcol" width="100%"><nobr> 631 <span class="sympad"><a href="#cloneSelector()">cloneSelector</a></span>()</nobr> 632 633 </td></tr> 634 635 636 637 </table> 638 639 640 641 642 643 <!-- ========== METHOD SUMMARY =========== --> 644 <table id="inhmethods" class="jd-sumtable"><tr><th> 645 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> 646 <div style="clear:left;">Inherited Methods</div></th></tr> 647 648 649 <tr class="api" > 650 <td colspan="12"> 651 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 652 ><img id="inherited-methods-java.lang.Object-trigger" 653 src="../../../../../assets/images/triangle-closed.png" 654 class="jd-expando-trigger-img" /></a> 655 From class 656 657 java.lang.Object 658 659 <div id="inherited-methods-java.lang.Object"> 660 <div id="inherited-methods-java.lang.Object-list" 661 class="jd-inheritedlinks"> 662 </div> 663 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 664 <table class="jd-sumtable-expando"> 665 666 667 668 669 <tr class="api" > 670 <td class="jd-typecol"><nobr> 671 672 673 674 675 676 Object</nobr> 677 </td> 678 <td class="jd-linkcol" width="100%"><nobr> 679 <span class="sympad">clone</span>()</nobr> 680 681 </td></tr> 682 683 684 685 <tr class="api" > 686 <td class="jd-typecol"><nobr> 687 688 689 690 691 692 boolean</nobr> 693 </td> 694 <td class="jd-linkcol" width="100%"><nobr> 695 <span class="sympad">equals</span>(Object arg0)</nobr> 696 697 </td></tr> 698 699 700 701 <tr class="api" > 702 <td class="jd-typecol"><nobr> 703 704 705 706 707 708 void</nobr> 709 </td> 710 <td class="jd-linkcol" width="100%"><nobr> 711 <span class="sympad">finalize</span>()</nobr> 712 713 </td></tr> 714 715 716 717 <tr class="api" > 718 <td class="jd-typecol"><nobr> 719 720 721 final 722 723 724 Class<?></nobr> 725 </td> 726 <td class="jd-linkcol" width="100%"><nobr> 727 <span class="sympad">getClass</span>()</nobr> 728 729 </td></tr> 730 731 732 733 <tr class="api" > 734 <td class="jd-typecol"><nobr> 735 736 737 738 739 740 int</nobr> 741 </td> 742 <td class="jd-linkcol" width="100%"><nobr> 743 <span class="sympad">hashCode</span>()</nobr> 744 745 </td></tr> 746 747 748 749 <tr class="api" > 750 <td class="jd-typecol"><nobr> 751 752 753 final 754 755 756 void</nobr> 757 </td> 758 <td class="jd-linkcol" width="100%"><nobr> 759 <span class="sympad">notify</span>()</nobr> 760 761 </td></tr> 762 763 764 765 <tr class="api" > 766 <td class="jd-typecol"><nobr> 767 768 769 final 770 771 772 void</nobr> 773 </td> 774 <td class="jd-linkcol" width="100%"><nobr> 775 <span class="sympad">notifyAll</span>()</nobr> 776 777 </td></tr> 778 779 780 781 <tr class="api" > 782 <td class="jd-typecol"><nobr> 783 784 785 786 787 788 String</nobr> 789 </td> 790 <td class="jd-linkcol" width="100%"><nobr> 791 <span class="sympad">toString</span>()</nobr> 792 793 </td></tr> 794 795 796 797 <tr class="api" > 798 <td class="jd-typecol"><nobr> 799 800 801 final 802 803 804 void</nobr> 805 </td> 806 <td class="jd-linkcol" width="100%"><nobr> 807 <span class="sympad">wait</span>()</nobr> 808 809 </td></tr> 810 811 812 813 <tr class="api" > 814 <td class="jd-typecol"><nobr> 815 816 817 final 818 819 820 void</nobr> 821 </td> 822 <td class="jd-linkcol" width="100%"><nobr> 823 <span class="sympad">wait</span>(long arg0, int arg1)</nobr> 824 825 </td></tr> 826 827 828 829 <tr class="api" > 830 <td class="jd-typecol"><nobr> 831 832 833 final 834 835 836 void</nobr> 837 </td> 838 <td class="jd-linkcol" width="100%"><nobr> 839 <span class="sympad">wait</span>(long arg0)</nobr> 840 841 </td></tr> 842 843 844 </table> 845 </div> 846 </div> 847 </td></tr> 848 849 850 </table> 851 852 853 </div><!-- jd-descr (summary) --> 854 855 <!-- Details --> 856 857 858 859 860 861 862 863 864 <!-- XML Attributes --> 865 866 867 <!-- Enum Values --> 868 869 870 <!-- Constants --> 871 872 873 <!-- Fields --> 874 875 876 <!-- Public ctors --> 877 878 879 <!-- ========= CONSTRUCTOR DETAIL ======== --> 880 <h2>Public Constructors</h2> 881 882 883 884 <A NAME="UiSelector()"></A> 885 886 <div class="jd-details api"> 887 <h4 class="jd-details-title"> 888 <span class="normal"> 889 public 890 891 892 893 894 895 </span> 896 <span class="sympad">UiSelector</span> 897 <span class="normal">()</span> 898 </h4> 899 <div class="api-level"> 900 <div></div> 901 902 903 904 </div> 905 <div class="jd-details-descr"> 906 907 <div class="jd-tagdata jd-tagdescr"><p></p></div> 908 909 </div> 910 </div> 911 912 913 914 915 916 <!-- ========= CONSTRUCTOR DETAIL ======== --> 917 <!-- Protected ctors --> 918 919 920 921 <!-- ========= METHOD DETAIL ======== --> 922 <!-- Public methdos --> 923 924 <h2>Public Methods</h2> 925 926 927 928 <A NAME="checkable(boolean)"></A> 929 930 <div class="jd-details api"> 931 <h4 class="jd-details-title"> 932 <span class="normal"> 933 public 934 935 936 937 938 <a href="#">UiSelector</a> 939 </span> 940 <span class="sympad">checkable</span> 941 <span class="normal">(boolean val)</span> 942 </h4> 943 <div class="jd-details-descr"> 944 945 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are checkable. 946 947 Typically, using this search criteria alone is not useful. 948 You should also include additional criteria, such as text, 949 content-description, or the class name for a widget. 950 951 If no other search criteria is specified, and there is more 952 than one matching widget, the first widget in the tree 953 is selected.</p></div> 954 <div class="jd-tagdata"> 955 <h5 class="jd-tagtitle">Parameters</h5> 956 <table class="jd-tagtable"> 957 <tr> 958 <th>val</td> 959 <td>Value to match</td> 960 </tr> 961 </table> 962 </div> 963 <div class="jd-tagdata"> 964 <h5 class="jd-tagtitle">Returns</h5> 965 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 966 </div> 967 <div class="jd-tagdata"> 968 <h5 class="jd-tagtitle">Since</h5> 969 <ul class="nolist"><li>Android API Level 18</li></ul> 970 </div> 971 </div> 972 </div> 973 974 975 <A NAME="checked(boolean)"></A> 976 977 <div class="jd-details api"> 978 <h4 class="jd-details-title"> 979 <span class="normal"> 980 public 981 982 983 984 985 <a href="#">UiSelector</a> 986 </span> 987 <span class="sympad">checked</span> 988 <span class="normal">(boolean val)</span> 989 </h4> 990 <div class="api-level"> 991 <div></div> 992 993 994 995 </div> 996 <div class="jd-details-descr"> 997 998 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that 999 are currently checked (usually for checkboxes). 1000 1001 Typically, using this search criteria alone is not useful. 1002 You should also include additional criteria, such as text, 1003 content-description, or the class name for a widget. 1004 1005 If no other search criteria is specified, and there is more 1006 than one matching widget, the first widget in the tree 1007 is selected.</p></div> 1008 <div class="jd-tagdata"> 1009 <h5 class="jd-tagtitle">Parameters</h5> 1010 <table class="jd-tagtable"> 1011 <tr> 1012 <th>val</td> 1013 <td>Value to match</td> 1014 </tr> 1015 </table> 1016 </div> 1017 <div class="jd-tagdata"> 1018 <h5 class="jd-tagtitle">Returns</h5> 1019 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1020 </div> 1021 1022 </div> 1023 </div> 1024 1025 1026 <A NAME="childSelector(com.android.uiautomator.core.UiSelector)"></A> 1027 1028 <div class="jd-details api"> 1029 <h4 class="jd-details-title"> 1030 <span class="normal"> 1031 public 1032 1033 1034 1035 1036 <a href="#">UiSelector</a> 1037 </span> 1038 <span class="sympad">childSelector</span> 1039 <span class="normal">(<a href="#">UiSelector</a> selector)</span> 1040 </h4> 1041 <div class="api-level"> 1042 <div></div> 1043 1044 1045 1046 </div> 1047 <div class="jd-details-descr"> 1048 1049 <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector. 1050 1051 Use this selector to narrow the search scope to 1052 child widgets under a specific parent widget.</p></div> 1053 <div class="jd-tagdata"> 1054 <h5 class="jd-tagtitle">Returns</h5> 1055 <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> 1056 </div> 1057 1058 </div> 1059 </div> 1060 1061 1062 <A NAME="className(java.lang.String)"></A> 1063 1064 <div class="jd-details api"> 1065 <h4 class="jd-details-title"> 1066 <span class="normal"> 1067 public 1068 1069 1070 1071 1072 <a href="#">UiSelector</a> 1073 </span> 1074 <span class="sympad">className</span> 1075 <span class="normal">(String className)</span> 1076 </h4> 1077 <div class="jd-details-descr"> 1078 1079 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property 1080 for a widget (for example, "android.widget.Button").</p></div> 1081 <div class="jd-tagdata"> 1082 <h5 class="jd-tagtitle">Parameters</h5> 1083 <table class="jd-tagtable"> 1084 <tr> 1085 <th>className</td> 1086 <td>Value to match</td> 1087 </tr> 1088 </table> 1089 </div> 1090 <div class="jd-tagdata"> 1091 <h5 class="jd-tagtitle">Returns</h5> 1092 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1093 </div> 1094 <div class="jd-tagdata"> 1095 <h5 class="jd-tagtitle">Since</h5> 1096 <ul class="nolist"><li>Android API Level 17</li></ul> 1097 </div> 1098 </div> 1099 </div> 1100 1101 1102 <A NAME="className(java.lang.Class<T>)"></A> 1103 1104 <div class="jd-details api"> 1105 <h4 class="jd-details-title"> 1106 <span class="normal"> 1107 public 1108 1109 1110 1111 1112 <a href="#">UiSelector</a> 1113 </span> 1114 <span class="sympad">className</span> 1115 <span class="normal">(Class<T> type)</span> 1116 </h4> 1117 <div class="api-level"> 1118 <div></div> 1119 1120 1121 1122 </div> 1123 <div class="jd-details-descr"> 1124 1125 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property 1126 for a widget (for example, "android.widget.Button").</p></div> 1127 <div class="jd-tagdata"> 1128 <h5 class="jd-tagtitle">Parameters</h5> 1129 <table class="jd-tagtable"> 1130 <tr> 1131 <th>type</td> 1132 <td>type</td> 1133 </tr> 1134 </table> 1135 </div> 1136 <div class="jd-tagdata"> 1137 <h5 class="jd-tagtitle">Returns</h5> 1138 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1139 </div> 1140 1141 </div> 1142 </div> 1143 1144 1145 <A NAME="classNameMatches(java.lang.String)"></A> 1146 1147 <div class="jd-details api"> 1148 <h4 class="jd-details-title"> 1149 <span class="normal"> 1150 public 1151 1152 1153 1154 1155 <a href="#">UiSelector</a> 1156 </span> 1157 <span class="sympad">classNameMatches</span> 1158 <span class="normal">(String regex)</span> 1159 </h4> 1160 <div class="jd-details-descr"> 1161 1162 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property 1163 for a widget, using a regular expression.</p></div> 1164 <div class="jd-tagdata"> 1165 <h5 class="jd-tagtitle">Parameters</h5> 1166 <table class="jd-tagtable"> 1167 <tr> 1168 <th>regex</td> 1169 <td>a regular expression</td> 1170 </tr> 1171 </table> 1172 </div> 1173 <div class="jd-tagdata"> 1174 <h5 class="jd-tagtitle">Returns</h5> 1175 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1176 </div> 1177 <div class="jd-tagdata"> 1178 <h5 class="jd-tagtitle">Since</h5> 1179 <ul class="nolist"><li>Android API Level 17</li></ul> 1180 </div> 1181 </div> 1182 </div> 1183 1184 1185 <A NAME="clickable(boolean)"></A> 1186 1187 <div class="jd-details api"> 1188 <h4 class="jd-details-title"> 1189 <span class="normal"> 1190 public 1191 1192 1193 1194 1195 <a href="#">UiSelector</a> 1196 </span> 1197 <span class="sympad">clickable</span> 1198 <span class="normal">(boolean val)</span> 1199 </h4> 1200 <div class="api-level"> 1201 <div></div> 1202 1203 1204 1205 </div> 1206 <div class="jd-details-descr"> 1207 1208 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are clickable. 1209 1210 Typically, using this search criteria alone is not useful. 1211 You should also include additional criteria, such as text, 1212 content-description, or the class name for a widget. 1213 1214 If no other search criteria is specified, and there is more 1215 than one matching widget, the first widget in the tree 1216 is selected.</p></div> 1217 <div class="jd-tagdata"> 1218 <h5 class="jd-tagtitle">Parameters</h5> 1219 <table class="jd-tagtable"> 1220 <tr> 1221 <th>val</td> 1222 <td>Value to match</td> 1223 </tr> 1224 </table> 1225 </div> 1226 <div class="jd-tagdata"> 1227 <h5 class="jd-tagtitle">Returns</h5> 1228 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1229 </div> 1230 1231 </div> 1232 </div> 1233 1234 1235 <A NAME="description(java.lang.String)"></A> 1236 1237 <div class="jd-details api"> 1238 <h4 class="jd-details-title"> 1239 <span class="normal"> 1240 public 1241 1242 1243 1244 1245 <a href="#">UiSelector</a> 1246 </span> 1247 <span class="sympad">description</span> 1248 <span class="normal">(String desc)</span> 1249 </h4> 1250 <div class="api-level"> 1251 <div></div> 1252 1253 1254 1255 </div> 1256 <div class="jd-details-descr"> 1257 1258 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description 1259 property for a widget. 1260 1261 The content-description is typically used 1262 by the Android Accessibility framework to 1263 provide an audio prompt for the widget when 1264 the widget is selected. The content-description 1265 for the widget must match exactly 1266 with the string in your input argument. 1267 1268 Matching is case-sensitive.</p></div> 1269 <div class="jd-tagdata"> 1270 <h5 class="jd-tagtitle">Parameters</h5> 1271 <table class="jd-tagtable"> 1272 <tr> 1273 <th>desc</td> 1274 <td>Value to match</td> 1275 </tr> 1276 </table> 1277 </div> 1278 <div class="jd-tagdata"> 1279 <h5 class="jd-tagtitle">Returns</h5> 1280 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1281 </div> 1282 1283 </div> 1284 </div> 1285 1286 1287 <A NAME="descriptionContains(java.lang.String)"></A> 1288 1289 <div class="jd-details api"> 1290 <h4 class="jd-details-title"> 1291 <span class="normal"> 1292 public 1293 1294 1295 1296 1297 <a href="#">UiSelector</a> 1298 </span> 1299 <span class="sympad">descriptionContains</span> 1300 <span class="normal">(String desc)</span> 1301 </h4> 1302 <div class="api-level"> 1303 <div></div> 1304 1305 1306 1307 </div> 1308 <div class="jd-details-descr"> 1309 1310 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description 1311 property for a widget. 1312 1313 The content-description is typically used 1314 by the Android Accessibility framework to 1315 provide an audio prompt for the widget when 1316 the widget is selected. The content-description 1317 for the widget must contain 1318 the string in your input argument. 1319 1320 Matching is case-insensitive.</p></div> 1321 <div class="jd-tagdata"> 1322 <h5 class="jd-tagtitle">Parameters</h5> 1323 <table class="jd-tagtable"> 1324 <tr> 1325 <th>desc</td> 1326 <td>Value to match</td> 1327 </tr> 1328 </table> 1329 </div> 1330 <div class="jd-tagdata"> 1331 <h5 class="jd-tagtitle">Returns</h5> 1332 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1333 </div> 1334 1335 </div> 1336 </div> 1337 1338 1339 <A NAME="descriptionMatches(java.lang.String)"></A> 1340 1341 <div class="jd-details api"> 1342 <h4 class="jd-details-title"> 1343 <span class="normal"> 1344 public 1345 1346 1347 1348 1349 <a href="#">UiSelector</a> 1350 </span> 1351 <span class="sympad">descriptionMatches</span> 1352 <span class="normal">(String regex)</span> 1353 </h4> 1354 <div class="jd-details-descr"> 1355 1356 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description 1357 property for a widget. 1358 1359 The content-description is typically used 1360 by the Android Accessibility framework to 1361 provide an audio prompt for the widget when 1362 the widget is selected. The content-description 1363 for the widget must match exactly 1364 with the string in your input argument.</p></div> 1365 <div class="jd-tagdata"> 1366 <h5 class="jd-tagtitle">Parameters</h5> 1367 <table class="jd-tagtable"> 1368 <tr> 1369 <th>regex</td> 1370 <td>a regular expression</td> 1371 </tr> 1372 </table> 1373 </div> 1374 <div class="jd-tagdata"> 1375 <h5 class="jd-tagtitle">Returns</h5> 1376 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1377 </div> 1378 <div class="jd-tagdata"> 1379 <h5 class="jd-tagtitle">Since</h5> 1380 <ul class="nolist"><li>Android API Level 17</li></ul> 1381 </div> 1382 </div> 1383 </div> 1384 1385 1386 <A NAME="descriptionStartsWith(java.lang.String)"></A> 1387 1388 <div class="jd-details api"> 1389 <h4 class="jd-details-title"> 1390 <span class="normal"> 1391 public 1392 1393 1394 1395 1396 <a href="#">UiSelector</a> 1397 </span> 1398 <span class="sympad">descriptionStartsWith</span> 1399 <span class="normal">(String desc)</span> 1400 </h4> 1401 <div class="api-level"> 1402 <div></div> 1403 1404 1405 1406 </div> 1407 <div class="jd-details-descr"> 1408 1409 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description 1410 property for a widget. 1411 1412 The content-description is typically used 1413 by the Android Accessibility framework to 1414 provide an audio prompt for the widget when 1415 the widget is selected. The content-description 1416 for the widget must start 1417 with the string in your input argument. 1418 1419 Matching is case-insensitive.</p></div> 1420 <div class="jd-tagdata"> 1421 <h5 class="jd-tagtitle">Parameters</h5> 1422 <table class="jd-tagtable"> 1423 <tr> 1424 <th>desc</td> 1425 <td>Value to match</td> 1426 </tr> 1427 </table> 1428 </div> 1429 <div class="jd-tagdata"> 1430 <h5 class="jd-tagtitle">Returns</h5> 1431 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1432 </div> 1433 1434 </div> 1435 </div> 1436 1437 1438 <A NAME="enabled(boolean)"></A> 1439 1440 <div class="jd-details api"> 1441 <h4 class="jd-details-title"> 1442 <span class="normal"> 1443 public 1444 1445 1446 1447 1448 <a href="#">UiSelector</a> 1449 </span> 1450 <span class="sympad">enabled</span> 1451 <span class="normal">(boolean val)</span> 1452 </h4> 1453 <div class="api-level"> 1454 <div></div> 1455 1456 1457 1458 </div> 1459 <div class="jd-details-descr"> 1460 1461 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are enabled. 1462 1463 Typically, using this search criteria alone is not useful. 1464 You should also include additional criteria, such as text, 1465 content-description, or the class name for a widget. 1466 1467 If no other search criteria is specified, and there is more 1468 than one matching widget, the first widget in the tree 1469 is selected.</p></div> 1470 <div class="jd-tagdata"> 1471 <h5 class="jd-tagtitle">Parameters</h5> 1472 <table class="jd-tagtable"> 1473 <tr> 1474 <th>val</td> 1475 <td>Value to match</td> 1476 </tr> 1477 </table> 1478 </div> 1479 <div class="jd-tagdata"> 1480 <h5 class="jd-tagtitle">Returns</h5> 1481 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1482 </div> 1483 1484 </div> 1485 </div> 1486 1487 1488 <A NAME="focusable(boolean)"></A> 1489 1490 <div class="jd-details api"> 1491 <h4 class="jd-details-title"> 1492 <span class="normal"> 1493 public 1494 1495 1496 1497 1498 <a href="#">UiSelector</a> 1499 </span> 1500 <span class="sympad">focusable</span> 1501 <span class="normal">(boolean val)</span> 1502 </h4> 1503 <div class="api-level"> 1504 <div></div> 1505 1506 1507 1508 </div> 1509 <div class="jd-details-descr"> 1510 1511 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are focusable. 1512 1513 Typically, using this search criteria alone is not useful. 1514 You should also include additional criteria, such as text, 1515 content-description, or the class name for a widget. 1516 1517 If no other search criteria is specified, and there is more 1518 than one matching widget, the first widget in the tree 1519 is selected.</p></div> 1520 <div class="jd-tagdata"> 1521 <h5 class="jd-tagtitle">Parameters</h5> 1522 <table class="jd-tagtable"> 1523 <tr> 1524 <th>val</td> 1525 <td>Value to match</td> 1526 </tr> 1527 </table> 1528 </div> 1529 <div class="jd-tagdata"> 1530 <h5 class="jd-tagtitle">Returns</h5> 1531 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1532 </div> 1533 1534 </div> 1535 </div> 1536 1537 1538 <A NAME="focused(boolean)"></A> 1539 1540 <div class="jd-details api"> 1541 <h4 class="jd-details-title"> 1542 <span class="normal"> 1543 public 1544 1545 1546 1547 1548 <a href="#">UiSelector</a> 1549 </span> 1550 <span class="sympad">focused</span> 1551 <span class="normal">(boolean val)</span> 1552 </h4> 1553 <div class="api-level"> 1554 <div></div> 1555 1556 1557 1558 </div> 1559 <div class="jd-details-descr"> 1560 1561 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that have focus. 1562 1563 Typically, using this search criteria alone is not useful. 1564 You should also include additional criteria, such as text, 1565 content-description, or the class name for a widget. 1566 1567 If no other search criteria is specified, and there is more 1568 than one matching widget, the first widget in the tree 1569 is selected.</p></div> 1570 <div class="jd-tagdata"> 1571 <h5 class="jd-tagtitle">Parameters</h5> 1572 <table class="jd-tagtable"> 1573 <tr> 1574 <th>val</td> 1575 <td>Value to match</td> 1576 </tr> 1577 </table> 1578 </div> 1579 <div class="jd-tagdata"> 1580 <h5 class="jd-tagtitle">Returns</h5> 1581 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1582 </div> 1583 1584 </div> 1585 </div> 1586 1587 1588 <A NAME="fromParent(com.android.uiautomator.core.UiSelector)"></A> 1589 1590 <div class="jd-details api"> 1591 <h4 class="jd-details-title"> 1592 <span class="normal"> 1593 public 1594 1595 1596 1597 1598 <a href="#">UiSelector</a> 1599 </span> 1600 <span class="sympad">fromParent</span> 1601 <span class="normal">(<a href="#">UiSelector</a> selector)</span> 1602 </h4> 1603 <div class="api-level"> 1604 <div></div> 1605 1606 1607 1608 </div> 1609 <div class="jd-details-descr"> 1610 1611 <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector which is used to 1612 start search from the parent widget. 1613 1614 Use this selector to narrow the search scope to 1615 sibling widgets as well all child widgets under a parent.</p></div> 1616 <div class="jd-tagdata"> 1617 <h5 class="jd-tagtitle">Returns</h5> 1618 <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> 1619 </div> 1620 1621 </div> 1622 </div> 1623 1624 1625 <A NAME="index(int)"></A> 1626 1627 <div class="jd-details api"> 1628 <h4 class="jd-details-title"> 1629 <span class="normal"> 1630 public 1631 1632 1633 1634 1635 <a href="#">UiSelector</a> 1636 </span> 1637 <span class="sympad">index</span> 1638 <span class="normal">(int index)</span> 1639 </h4> 1640 <div class="api-level"> 1641 <div></div> 1642 1643 1644 1645 </div> 1646 <div class="jd-details-descr"> 1647 1648 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the widget by its node 1649 index in the layout hierarchy. 1650 1651 The index value must be 0 or greater. 1652 1653 Using the index can be unreliable and should only 1654 be used as a last resort for matching. Instead, 1655 consider using the <code><a href="#instance(int)">instance(int)</a></code> method.</p></div> 1656 <div class="jd-tagdata"> 1657 <h5 class="jd-tagtitle">Parameters</h5> 1658 <table class="jd-tagtable"> 1659 <tr> 1660 <th>index</td> 1661 <td>Value to match</td> 1662 </tr> 1663 </table> 1664 </div> 1665 <div class="jd-tagdata"> 1666 <h5 class="jd-tagtitle">Returns</h5> 1667 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1668 </div> 1669 1670 </div> 1671 </div> 1672 1673 1674 <A NAME="instance(int)"></A> 1675 1676 <div class="jd-details api"> 1677 <h4 class="jd-details-title"> 1678 <span class="normal"> 1679 public 1680 1681 1682 1683 1684 <a href="#">UiSelector</a> 1685 </span> 1686 <span class="sympad">instance</span> 1687 <span class="normal">(int instance)</span> 1688 </h4> 1689 <div class="api-level"> 1690 <div></div> 1691 1692 1693 1694 </div> 1695 <div class="jd-details-descr"> 1696 1697 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the 1698 widget by its instance number. 1699 1700 The instance value must be 0 or greater, where 1701 the first instance is 0. 1702 1703 For example, to simulate a user click on 1704 the third image that is enabled in a UI screen, you 1705 could specify a a search criteria where the instance is 1706 2, the <code><a href="#className(java.lang.String)">className(String)</a></code> matches the image 1707 widget class, and <code><a href="#enabled(boolean)">enabled(boolean)</a></code> is true. 1708 The code would look like this: 1709 <code> 1710 new UiSelector().className("android.widget.ImageView") 1711 .enabled(true).instance(2); 1712 </code></p></div> 1713 <div class="jd-tagdata"> 1714 <h5 class="jd-tagtitle">Parameters</h5> 1715 <table class="jd-tagtable"> 1716 <tr> 1717 <th>instance</td> 1718 <td>Value to match</td> 1719 </tr> 1720 </table> 1721 </div> 1722 <div class="jd-tagdata"> 1723 <h5 class="jd-tagtitle">Returns</h5> 1724 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1725 </div> 1726 1727 </div> 1728 </div> 1729 1730 1731 <A NAME="longClickable(boolean)"></A> 1732 1733 <div class="jd-details api"> 1734 <h4 class="jd-details-title"> 1735 <span class="normal"> 1736 public 1737 1738 1739 1740 1741 <a href="#">UiSelector</a> 1742 </span> 1743 <span class="sympad">longClickable</span> 1744 <span class="normal">(boolean val)</span> 1745 </h4> 1746 <div class="jd-details-descr"> 1747 1748 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are long-clickable. 1749 1750 Typically, using this search criteria alone is not useful. 1751 You should also include additional criteria, such as text, 1752 content-description, or the class name for a widget. 1753 1754 If no other search criteria is specified, and there is more 1755 than one matching widget, the first widget in the tree 1756 is selected.</p></div> 1757 <div class="jd-tagdata"> 1758 <h5 class="jd-tagtitle">Parameters</h5> 1759 <table class="jd-tagtable"> 1760 <tr> 1761 <th>val</td> 1762 <td>Value to match</td> 1763 </tr> 1764 </table> 1765 </div> 1766 <div class="jd-tagdata"> 1767 <h5 class="jd-tagtitle">Returns</h5> 1768 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1769 </div> 1770 <div class="jd-tagdata"> 1771 <h5 class="jd-tagtitle">Since</h5> 1772 <ul class="nolist"><li>Android API Level 17</li></ul> 1773 </div> 1774 </div> 1775 </div> 1776 1777 1778 <A NAME="packageName(java.lang.String)"></A> 1779 1780 <div class="jd-details api"> 1781 <h4 class="jd-details-title"> 1782 <span class="normal"> 1783 public 1784 1785 1786 1787 1788 <a href="#">UiSelector</a> 1789 </span> 1790 <span class="sympad">packageName</span> 1791 <span class="normal">(String name)</span> 1792 </h4> 1793 <div class="api-level"> 1794 <div></div> 1795 1796 1797 1798 </div> 1799 <div class="jd-details-descr"> 1800 1801 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name 1802 of the application that contains the widget.</p></div> 1803 <div class="jd-tagdata"> 1804 <h5 class="jd-tagtitle">Parameters</h5> 1805 <table class="jd-tagtable"> 1806 <tr> 1807 <th>name</td> 1808 <td>Value to match</td> 1809 </tr> 1810 </table> 1811 </div> 1812 <div class="jd-tagdata"> 1813 <h5 class="jd-tagtitle">Returns</h5> 1814 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1815 </div> 1816 1817 </div> 1818 </div> 1819 1820 1821 <A NAME="packageNameMatches(java.lang.String)"></A> 1822 1823 <div class="jd-details api"> 1824 <h4 class="jd-details-title"> 1825 <span class="normal"> 1826 public 1827 1828 1829 1830 1831 <a href="#">UiSelector</a> 1832 </span> 1833 <span class="sympad">packageNameMatches</span> 1834 <span class="normal">(String regex)</span> 1835 </h4> 1836 <div class="jd-details-descr"> 1837 1838 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name 1839 of the application that contains the widget.</p></div> 1840 <div class="jd-tagdata"> 1841 <h5 class="jd-tagtitle">Parameters</h5> 1842 <table class="jd-tagtable"> 1843 <tr> 1844 <th>regex</td> 1845 <td>a regular expression</td> 1846 </tr> 1847 </table> 1848 </div> 1849 <div class="jd-tagdata"> 1850 <h5 class="jd-tagtitle">Returns</h5> 1851 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1852 </div> 1853 <div class="jd-tagdata"> 1854 <h5 class="jd-tagtitle">Since</h5> 1855 <ul class="nolist"><li>Android API Level 17</li></ul> 1856 </div> 1857 </div> 1858 </div> 1859 1860 1861 <A NAME="resourceId(java.lang.String)"></A> 1862 1863 <div class="jd-details api"> 1864 <h4 class="jd-details-title"> 1865 <span class="normal"> 1866 public 1867 1868 1869 1870 1871 <a href="#">UiSelector</a> 1872 </span> 1873 <span class="sympad">resourceId</span> 1874 <span class="normal">(String id)</span> 1875 </h4> 1876 <div class="jd-details-descr"> 1877 1878 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the given resource ID.</p></div> 1879 <div class="jd-tagdata"> 1880 <h5 class="jd-tagtitle">Parameters</h5> 1881 <table class="jd-tagtable"> 1882 <tr> 1883 <th>id</td> 1884 <td>Value to match</td> 1885 </tr> 1886 </table> 1887 </div> 1888 <div class="jd-tagdata"> 1889 <h5 class="jd-tagtitle">Returns</h5> 1890 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1891 </div> 1892 <div class="jd-tagdata"> 1893 <h5 class="jd-tagtitle">Since</h5> 1894 <ul class="nolist"><li>Android API Level 18</li></ul> 1895 </div> 1896 </div> 1897 </div> 1898 1899 1900 <A NAME="resourceIdMatches(java.lang.String)"></A> 1901 1902 <div class="jd-details api"> 1903 <h4 class="jd-details-title"> 1904 <span class="normal"> 1905 public 1906 1907 1908 1909 1910 <a href="#">UiSelector</a> 1911 </span> 1912 <span class="sympad">resourceIdMatches</span> 1913 <span class="normal">(String regex)</span> 1914 </h4> 1915 <div class="jd-details-descr"> 1916 1917 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the resource ID 1918 of the widget, using a regular expression.http://blog.bettersoftwaretesting.com/</p></div> 1919 <div class="jd-tagdata"> 1920 <h5 class="jd-tagtitle">Parameters</h5> 1921 <table class="jd-tagtable"> 1922 <tr> 1923 <th>regex</td> 1924 <td>a regular expression</td> 1925 </tr> 1926 </table> 1927 </div> 1928 <div class="jd-tagdata"> 1929 <h5 class="jd-tagtitle">Returns</h5> 1930 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1931 </div> 1932 <div class="jd-tagdata"> 1933 <h5 class="jd-tagtitle">Since</h5> 1934 <ul class="nolist"><li>Android API Level 18</li></ul> 1935 </div> 1936 </div> 1937 </div> 1938 1939 1940 <A NAME="scrollable(boolean)"></A> 1941 1942 <div class="jd-details api"> 1943 <h4 class="jd-details-title"> 1944 <span class="normal"> 1945 public 1946 1947 1948 1949 1950 <a href="#">UiSelector</a> 1951 </span> 1952 <span class="sympad">scrollable</span> 1953 <span class="normal">(boolean val)</span> 1954 </h4> 1955 <div class="api-level"> 1956 <div></div> 1957 1958 1959 1960 </div> 1961 <div class="jd-details-descr"> 1962 1963 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are scrollable. 1964 1965 Typically, using this search criteria alone is not useful. 1966 You should also include additional criteria, such as text, 1967 content-description, or the class name for a widget. 1968 1969 If no other search criteria is specified, and there is more 1970 than one matching widget, the first widget in the tree 1971 is selected.</p></div> 1972 <div class="jd-tagdata"> 1973 <h5 class="jd-tagtitle">Parameters</h5> 1974 <table class="jd-tagtable"> 1975 <tr> 1976 <th>val</td> 1977 <td>Value to match</td> 1978 </tr> 1979 </table> 1980 </div> 1981 <div class="jd-tagdata"> 1982 <h5 class="jd-tagtitle">Returns</h5> 1983 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 1984 </div> 1985 1986 </div> 1987 </div> 1988 1989 1990 <A NAME="selected(boolean)"></A> 1991 1992 <div class="jd-details api"> 1993 <h4 class="jd-details-title"> 1994 <span class="normal"> 1995 public 1996 1997 1998 1999 2000 <a href="#">UiSelector</a> 2001 </span> 2002 <span class="sympad">selected</span> 2003 <span class="normal">(boolean val)</span> 2004 </h4> 2005 <div class="api-level"> 2006 <div></div> 2007 2008 2009 2010 </div> 2011 <div class="jd-details-descr"> 2012 2013 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that 2014 are currently selected. 2015 2016 Typically, using this search criteria alone is not useful. 2017 You should also include additional criteria, such as text, 2018 content-description, or the class name for a widget. 2019 2020 If no other search criteria is specified, and there is more 2021 than one matching widget, the first widget in the tree 2022 is selected.</p></div> 2023 <div class="jd-tagdata"> 2024 <h5 class="jd-tagtitle">Parameters</h5> 2025 <table class="jd-tagtable"> 2026 <tr> 2027 <th>val</td> 2028 <td>Value to match</td> 2029 </tr> 2030 </table> 2031 </div> 2032 <div class="jd-tagdata"> 2033 <h5 class="jd-tagtitle">Returns</h5> 2034 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 2035 </div> 2036 2037 </div> 2038 </div> 2039 2040 2041 <A NAME="text(java.lang.String)"></A> 2042 2043 <div class="jd-details api"> 2044 <h4 class="jd-details-title"> 2045 <span class="normal"> 2046 public 2047 2048 2049 2050 2051 <a href="#">UiSelector</a> 2052 </span> 2053 <span class="sympad">text</span> 2054 <span class="normal">(String text)</span> 2055 </h4> 2056 <div class="api-level"> 2057 <div></div> 2058 2059 2060 2061 </div> 2062 <div class="jd-details-descr"> 2063 2064 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed 2065 in a widget (for example, the text label to launch an app). 2066 2067 The text for the element must match exactly with the string in your input 2068 argument. Matching is case-sensitive.</p></div> 2069 <div class="jd-tagdata"> 2070 <h5 class="jd-tagtitle">Parameters</h5> 2071 <table class="jd-tagtable"> 2072 <tr> 2073 <th>text</td> 2074 <td>Value to match</td> 2075 </tr> 2076 </table> 2077 </div> 2078 <div class="jd-tagdata"> 2079 <h5 class="jd-tagtitle">Returns</h5> 2080 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 2081 </div> 2082 2083 </div> 2084 </div> 2085 2086 2087 <A NAME="textContains(java.lang.String)"></A> 2088 2089 <div class="jd-details api"> 2090 <h4 class="jd-details-title"> 2091 <span class="normal"> 2092 public 2093 2094 2095 2096 2097 <a href="#">UiSelector</a> 2098 </span> 2099 <span class="sympad">textContains</span> 2100 <span class="normal">(String text)</span> 2101 </h4> 2102 <div class="api-level"> 2103 <div></div> 2104 2105 2106 2107 </div> 2108 <div class="jd-details-descr"> 2109 2110 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text in a widget 2111 where the visible text must contain the string in your input argument. 2112 2113 The matching is case-sensitive.</p></div> 2114 <div class="jd-tagdata"> 2115 <h5 class="jd-tagtitle">Parameters</h5> 2116 <table class="jd-tagtable"> 2117 <tr> 2118 <th>text</td> 2119 <td>Value to match</td> 2120 </tr> 2121 </table> 2122 </div> 2123 <div class="jd-tagdata"> 2124 <h5 class="jd-tagtitle">Returns</h5> 2125 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 2126 </div> 2127 2128 </div> 2129 </div> 2130 2131 2132 <A NAME="textMatches(java.lang.String)"></A> 2133 2134 <div class="jd-details api"> 2135 <h4 class="jd-details-title"> 2136 <span class="normal"> 2137 public 2138 2139 2140 2141 2142 <a href="#">UiSelector</a> 2143 </span> 2144 <span class="sympad">textMatches</span> 2145 <span class="normal">(String regex)</span> 2146 </h4> 2147 <div class="jd-details-descr"> 2148 2149 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed in a layout 2150 element, using a regular expression. 2151 2152 The text in the widget must match exactly with the string in your 2153 input argument.</p></div> 2154 <div class="jd-tagdata"> 2155 <h5 class="jd-tagtitle">Parameters</h5> 2156 <table class="jd-tagtable"> 2157 <tr> 2158 <th>regex</td> 2159 <td>a regular expression</td> 2160 </tr> 2161 </table> 2162 </div> 2163 <div class="jd-tagdata"> 2164 <h5 class="jd-tagtitle">Returns</h5> 2165 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 2166 </div> 2167 <div class="jd-tagdata"> 2168 <h5 class="jd-tagtitle">Since</h5> 2169 <ul class="nolist"><li>Android API Level 17</li></ul> 2170 </div> 2171 </div> 2172 </div> 2173 2174 2175 <A NAME="textStartsWith(java.lang.String)"></A> 2176 2177 <div class="jd-details api"> 2178 <h4 class="jd-details-title"> 2179 <span class="normal"> 2180 public 2181 2182 2183 2184 2185 <a href="#">UiSelector</a> 2186 </span> 2187 <span class="sympad">textStartsWith</span> 2188 <span class="normal">(String text)</span> 2189 </h4> 2190 <div class="api-level"> 2191 <div></div> 2192 2193 2194 2195 </div> 2196 <div class="jd-details-descr"> 2197 2198 <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match visible text in a widget that is 2199 prefixed by the text parameter. 2200 2201 The matching is case-insensitive.</p></div> 2202 <div class="jd-tagdata"> 2203 <h5 class="jd-tagtitle">Parameters</h5> 2204 <table class="jd-tagtable"> 2205 <tr> 2206 <th>text</td> 2207 <td>Value to match</td> 2208 </tr> 2209 </table> 2210 </div> 2211 <div class="jd-tagdata"> 2212 <h5 class="jd-tagtitle">Returns</h5> 2213 <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> 2214 </div> 2215 2216 </div> 2217 </div> 2218 2219 2220 <A NAME="toString()"></A> 2221 2222 <div class="jd-details api"> 2223 <h4 class="jd-details-title"> 2224 <span class="normal"> 2225 public 2226 2227 2228 2229 2230 String 2231 </span> 2232 <span class="sympad">toString</span> 2233 <span class="normal">()</span> 2234 </h4> 2235 <div class="api-level"> 2236 <div></div> 2237 2238 2239 2240 </div> 2241 <div class="jd-details-descr"> 2242 2243 <div class="jd-tagdata jd-tagdescr"><p></p></div> 2244 2245 </div> 2246 </div> 2247 2248 2249 2250 2251 2252 <!-- ========= METHOD DETAIL ======== --> 2253 2254 <h2>Protected Methods</h2> 2255 2256 2257 2258 <A NAME="cloneSelector()"></A> 2259 2260 <div class="jd-details api"> 2261 <h4 class="jd-details-title"> 2262 <span class="normal"> 2263 protected 2264 2265 2266 2267 2268 <a href="#">UiSelector</a> 2269 </span> 2270 <span class="sympad">cloneSelector</span> 2271 <span class="normal">()</span> 2272 </h4> 2273 <div class="jd-details-descr"> 2274 2275 <div class="jd-tagdata"> 2276 <h5 class="jd-tagtitle">Since</h5> 2277 <ul class="nolist"><li>Android API Level 17</li></ul> 2278 </div> 2279 2280 </div> 2281 2282 2283 2284 2285 2286 2287