blob: 3eb721f9758fd9604ea26c78e2c817446319057d [file] [log] [blame]
Quddus Chong489218c2015-02-26 16:38:46 -08001<!DOCTYPE html>
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98<html>
99<head>
100
101
102<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
103<meta name="viewport" content="width=device-width" />
104
105<link rel="shortcut icon" type="image/x-icon" href="../../../../../favicon.ico" />
106<title>UiDevice | Android Developers</title>
107
108<!-- STYLESHEETS -->
109<link rel="stylesheet"
110href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
111<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
112 title="roboto">
113<link href="../../../../../assets/css/default.css?v=2" rel="stylesheet" type="text/css">
114
115
116<!-- FULLSCREEN STYLESHEET -->
117<link href="../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
118type="text/css">
119
120
121<!-- JAVASCRIPT -->
122<script src="http://www.google.com/jsapi" type="text/javascript"></script>
123<script src="../../../../../assets/js/android_3p-bundle.js" type="text/javascript"></script>
124<script type="text/javascript">
125 var toRoot = "../../../../../";
126 var metaTags = [];
127 var devsite = false;
128</script>
129<script src="../../../../../assets/js/docs.js?v=2" type="text/javascript"></script>
130
131<script>
132 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
133 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
134 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
135 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
136
137 ga('create', 'UA-5831155-1', 'android.com');
138 ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker);
139 ga('send', 'pageview');
140 ga('universal.send', 'pageview'); // Send page view for new tracker.
141</script>
142
143</head>
144
145<body class="gc-documentation
146 develop reference" itemscope itemtype="http://schema.org/Article">
147 <div id="doc-api-level" class="" style="display:none"></div>
148 <a name="top"></a>
149
150
151<a name="top"></a>
152
153 <!-- Header -->
154 <div id="header-wrapper">
155 <div id="header">
156
157
158
159
160 <div class="wrap" id="header-wrap">
161 <div class="col-3 logo">
162 <a href="../../../../../index.html">
163 <img src="../../../../../assets/images/dac_logo.png"
164 srcset="../../../../../assets/images/dac_logo@2x.png 2x"
165 width="123" height="25" alt="Android Developers" />
166 </a>
167 <div class="btn-quicknav" id="btn-quicknav">
168 <a href="#" class="arrow-inactive">Quicknav</a>
169 <a href="#" class="arrow-active">Quicknav</a>
170 </div>
171 </div>
172 <ul class="nav-x col-9">
173 <li class="design">
174 <a href="../../../../../design/index.html"
175 zh-tw-lang="設計"
176 zh-cn-lang="设计"
177 ru-lang="Проектирование"
178 ko-lang="디자인"
179 ja-lang="設計"
180 es-lang="Diseñar"
181 >Design</a></li>
182 <li class="develop"><a href="../../../../../develop/index.html"
183 zh-tw-lang="開發"
184 zh-cn-lang="开发"
185 ru-lang="Разработка"
186 ko-lang="개발"
187 ja-lang="開発"
188 es-lang="Desarrollar"
189 >Develop</a></li>
190 <li class="distribute last"><a href="../../../../../distribute/index.html"
191 zh-tw-lang="發佈"
192 zh-cn-lang="分发"
193 ru-lang="Распространение"
194 ko-lang="배포"
195 ja-lang="配布"
196 es-lang="Distribuir"
197 >Distribute</a></li>
198 </ul>
199
200
201
202
203<div class="menu-container">
204 <div class="moremenu">
205 <div id="more-btn"></div>
206 </div>
207 <div class="morehover" id="moremenu">
208 <div class="top"></div>
209 <div class="mid">
210 <div class="header">Links</div>
211 <ul>
212 <li><a href="https://play.google.com/apps/publish/" target="_googleplay">Google Play Developer Console</a></li>
213 <li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li>
214 <li><a href="../../../../../about/index.html">About Android</a></li>
215 </ul>
216 <div class="header">Android Sites</div>
217 <ul>
218 <li><a href="http://www.android.com">Android.com</a></li>
219 <li class="active"><a>Android Developers</a></li>
220 <li><a href="http://source.android.com">Android Open Source Project</a></li>
221 </ul>
222
223
224
225
226 <br class="clearfix" />
227 </div><!-- end 'mid' -->
228 <div class="bottom"></div>
229 </div><!-- end 'moremenu' -->
230
231 <div class="search" id="search-container">
232 <div class="search-inner">
233 <div id="search-btn"></div>
234 <div class="left"></div>
235 <form onsubmit="return submit_search()">
236 <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
237 onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
238 onkeydown="return search_changed(event, true, '../../../../../')"
239 onkeyup="return search_changed(event, false, '../../../../../')" />
240 </form>
241 <div class="right"></div>
242 <a class="close hide">close</a>
243 <div class="left"></div>
244 <div class="right"></div>
245 </div><!-- end search-inner -->
246 </div><!-- end search-container -->
247
248 <div class="search_filtered_wrapper reference">
249 <div class="suggest-card reference no-display">
250 <ul class="search_filtered">
251 </ul>
252 </div>
253 </div>
254
255 <div class="search_filtered_wrapper docs">
256 <div class="suggest-card dummy no-display">&nbsp;</div>
257 <div class="suggest-card develop no-display">
258 <ul class="search_filtered">
259 </ul>
260 <div class="child-card guides no-display">
261 </div>
262 <div class="child-card training no-display">
263 </div>
264 <div class="child-card samples no-display">
265 </div>
266 </div>
267 <div class="suggest-card design no-display">
268 <ul class="search_filtered">
269 </ul>
270 </div>
271 <div class="suggest-card distribute no-display">
272 <ul class="search_filtered">
273 </ul>
274 </div>
275 </div>
276</div><!-- end menu-container (search and menu widget) -->
277
278
279
280 <!-- Expanded quicknav -->
281 <div id="quicknav" class="col-13">
282 <ul>
283 <li class="about">
284 <ul>
285 <li><a href="../../../../../about/index.html">About</a></li>
286 <li><a href="../../../../../wear/index.html">Wear</a></li>
287 <li><a href="../../../../../tv/index.html">TV</a></li>
288 <li><a href="../../../../../auto/index.html">Auto</a></li>
289 </ul>
290 </li>
291 <li class="design">
292 <ul>
293 <li><a href="../../../../../design/index.html">Get Started</a></li>
294 <li><a href="../../../../../design/devices.html">Devices</a></li>
295 <li><a href="../../../../../design/style/index.html">Style</a></li>
296 <li><a href="../../../../../design/patterns/index.html">Patterns</a></li>
297 <li><a href="../../../../../design/building-blocks/index.html">Building Blocks</a></li>
298 <li><a href="../../../../../design/downloads/index.html">Downloads</a></li>
299 <li><a href="../../../../../design/videos/index.html">Videos</a></li>
300 </ul>
301 </li>
302 <li class="develop">
303 <ul>
304 <li><a href="../../../../../training/index.html"
305 zh-tw-lang="訓練課程"
306 zh-cn-lang="培训"
307 ru-lang="Курсы"
308 ko-lang="교육"
309 ja-lang="トレーニング"
310 es-lang="Capacitación"
311 >Training</a></li>
312 <li><a href="../../../../../guide/index.html"
313 zh-tw-lang="API 指南"
314 zh-cn-lang="API 指南"
315 ru-lang="Руководства по API"
316 ko-lang="API 가이드"
317 ja-lang="API ガイド"
318 es-lang="Guías de la API"
319 >API Guides</a></li>
320 <li><a href="../../../../../reference/packages.html"
321 zh-tw-lang="參考資源"
322 zh-cn-lang="参考"
323 ru-lang="Справочник"
324 ko-lang="참조문서"
325 ja-lang="リファレンス"
326 es-lang="Referencia"
327 >Reference</a></li>
328 <li><a href="../../../../../sdk/index.html"
329 zh-tw-lang="相關工具"
330 zh-cn-lang="工具"
331 ru-lang="Инструменты"
332 ko-lang="도구"
333 ja-lang="ツール"
334 es-lang="Herramientas"
335 >Tools</a>
336 </li>
337 <li><a href="../../../../../google/index.html">Google Services</a>
338 </li>
339
340 </ul>
341 </li>
342 <li class="distribute last">
343 <ul>
344 <li><a href="../../../../../distribute/googleplay/index.html">Google Play</a></li>
345 <li><a href="../../../../../distribute/essentials/index.html">Essentials</a></li>
346 <li><a href="../../../../../distribute/users/index.html">Get Users</a></li>
347 <li><a href="../../../../../distribute/engage/index.html">Engage &amp; Retain</a></li>
348 <li><a href="../../../../../distribute/monetize/index.html">Monetize</a></li>
349 <li><a href="../../../../../distribute/tools/index.html">Tools &amp; Reference</a></li>
350 <li><a href="../../../../../distribute/stories/index.html">Developer Stories</a></li>
351 </ul>
352 </li>
353 </ul>
354 </div><!-- /Expanded quicknav -->
355 </div><!-- end header-wrap.wrap -->
356 </div><!-- end header -->
357
358
359 <!-- Secondary x-nav -->
360 <div id="nav-x">
361 <div class="wrap" style="position:relative;z-index:1">
362
363
364 <a id="helpoutsLink" class="resource resource-card resource-card-6x2x3 resource-card-6x2 helpouts-card"
365 href="http://helpouts.google.com/partner/landing/provider/googledevelopers" target="_blank">
366 <div class="card-bg helpouts-card-bg"></div>
367 <div class="card-info">
368 <div class="helpouts-description">
369 <div class="text">Help developers solve problems<br/>
370 <span id="helpoutsLinkText" class="link-color" style="display:block;padding-top:5px;text-align:right">Learn more</span>
371 </div>
372 </div>
373 </div>
374 </a>
375 <script>
376 var textA = "LEARN MORE";
377 var linkA = "http://helpouts.google.com/partner/landing/provider/googledevelopers?utm_source=android_banner1&utm_medium=banner&utm_campaign=android_provider_banner1";
378 var textB = "SIGN UP NOW";
379 var linkB = "http://helpouts.google.com/partner/landing/provider/googledevelopers?utm_source=android_banner2&utm_medium=banner&utm_campaign=android_provider_banner2";
380
381 if (Math.floor(1/Math.random()) > 1) {
382 $("a#helpoutsLink").attr('href', linkA);
383 $("span#helpoutsLinkText").text(textA);
384 } else {
385 $("a#helpoutsLink").attr('href', linkB);
386 $("span#helpoutsLinkText").text(textB);
387 }
388 </script>
389
390
391 <ul class="nav-x col-9 develop" style="width:100%">
392 <li class="training"><a href="../../../../../training/index.html"
393 zh-tw-lang="訓練課程"
394 zh-cn-lang="培训"
395 ru-lang="Курсы"
396 ko-lang="교육"
397 ja-lang="トレーニング"
398 es-lang="Capacitación"
399 >Training</a></li>
400 <li class="guide"><a href="../../../../../guide/index.html"
401 zh-tw-lang="API 指南"
402 zh-cn-lang="API 指南"
403 ru-lang="Руководства по API"
404 ko-lang="API 가이드"
405 ja-lang="API ガイド"
406 es-lang="Guías de la API"
407 >API Guides</a></li>
408 <li class="reference"><a href="../../../../../reference/packages.html"
409 zh-tw-lang="參考資源"
410 zh-cn-lang="参考"
411 ru-lang="Справочник"
412 ko-lang="참조문서"
413 ja-lang="リファレンス"
414 es-lang="Referencia"
415 >Reference</a></li>
416 <li class="tools"><a href="../../../../../sdk/index.html"
417 zh-tw-lang="相關工具"
418 zh-cn-lang="工具"
419 ru-lang="Инструменты"
420 ko-lang="도구"
421 ja-lang="ツール"
422 es-lang="Herramientas"
423 >Tools</a></li>
424 <li class="google"><a href="../../../../../google/index.html"
425 >Google Services</a>
426 </li>
427
428 </ul>
429 </div>
430 </div>
431 <!-- /Sendondary x-nav DEVELOP -->
432
433
434
435 <div id="searchResults" class="wrap" style="display:none;">
436 <h2 id="searchTitle">Results</h2>
437 <div id="leftSearchControl" class="search-control">Loading...</div>
438 </div>
439 </div> <!--end header-wrapper -->
440
441 <div id="sticky-header">
442 <div>
443 <a class="logo" href="#top"></a>
444 <a class="top" href="#top"></a>
445 <ul class="breadcrumb">
446
447 <li class="current">UiDevice</li>
448 </ul>
449 </div>
450 </div>
451
452
453
454
455
456 <div class="wrap clearfix" id="body-content">
457 <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
458 <div id="devdoc-nav">
459 <div id="api-nav-header">
460 <div id="api-level-toggle">
461 <label for="apiLevelCheckbox" class="disabled"
462 title="Select your target API level to dim unavailable APIs">API level: </label>
463 <div class="select-wrapper">
464 <select id="apiLevelSelector">
465 <!-- option elements added by buildApiLevelSelector() -->
466 </select>
467 </div>
468 </div><!-- end toggle -->
469 <div id="api-nav-title">Android APIs</div>
470 </div><!-- end nav header -->
471 <script>
472 var SINCE_DATA = [ ];
473 buildApiLevelSelector();
474 </script>
475
476 <div id="swapper">
477 <div id="nav-panels">
478 <div id="resize-packages-nav">
479 <div id="packages-nav" class="scroll-pane">
480
481 <ul>
482
483 <li class="api apilevel-">
484 <a href="../../../../../reference/android/support/test/package-summary.html">android.support.test</a></li>
485 <li class="api apilevel-">
486 <a href="../../../../../reference/android/support/test/espresso/package-summary.html">android.support.test.espresso</a></li>
487 <li class="api apilevel-">
488 <a href="../../../../../reference/android/support/test/espresso/action/package-summary.html">android.support.test.espresso.action</a></li>
489 <li class="api apilevel-">
490 <a href="../../../../../reference/android/support/test/espresso/assertion/package-summary.html">android.support.test.espresso.assertion</a></li>
491 <li class="api apilevel-">
492 <a href="../../../../../reference/android/support/test/espresso/base/package-summary.html">android.support.test.espresso.base</a></li>
493 <li class="api apilevel-">
494 <a href="../../../../../reference/android/support/test/espresso/contrib/package-summary.html">android.support.test.espresso.contrib</a></li>
495 <li class="api apilevel-">
496 <a href="../../../../../reference/android/support/test/espresso/matcher/package-summary.html">android.support.test.espresso.matcher</a></li>
497 <li class="api apilevel-">
498 <a href="../../../../../reference/android/support/test/espresso/util/package-summary.html">android.support.test.espresso.util</a></li>
499 <li class="api apilevel-">
500 <a href="../../../../../reference/android/support/test/filters/package-summary.html">android.support.test.filters</a></li>
501 <li class="api apilevel-">
502 <a href="../../../../../reference/android/support/test/runner/package-summary.html">android.support.test.runner</a></li>
503 <li class="api apilevel-">
504 <a href="../../../../../reference/android/support/test/runner/lifecycle/package-summary.html">android.support.test.runner.lifecycle</a></li>
505 <li class="selected api apilevel-">
506 <a href="../../../../../reference/android/support/test/uiautomator/package-summary.html">android.support.test.uiautomator</a></li>
507 </ul><br/>
508
509 </div> <!-- end packages-nav -->
510 </div> <!-- end resize-packages -->
511 <div id="classes-nav" class="scroll-pane">
512
513
514
515 <ul>
516
517
518 <li><h2>Interfaces</h2>
519 <ul>
520 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/IAutomationSupport.html">IAutomationSupport</a></li>
521 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></li>
522 </ul>
523 </li>
524
525 <li><h2>Classes</h2>
526 <ul>
527 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/By.html">By</a></li>
528 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a></li>
529 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/Configurator.html">Configurator</a></li>
530 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a></li>
531 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a></li>
532 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html">UiAutomatorInstrumentationTestRunner</a></li>
533 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiAutomatorTestCase.html">UiAutomatorTestCase</a></li>
534 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></li>
535 <li class="selected api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a></li>
536 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiObject.html">UiObject</a></li>
537 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a></li>
538 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiObject2Condition.html">UiObject2Condition</a></li>
539 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></li>
540 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></li>
541 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/Until.html">Until</a></li>
542 </ul>
543 </li>
544
545 <li><h2>Enums</h2>
546 <ul>
547 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/Direction.html">Direction</a></li>
548 </ul>
549 </li>
550
551 <li><h2>Exceptions</h2>
552 <ul>
553 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/StaleObjectException.html">StaleObjectException</a></li>
554 <li class="api apilevel-"><a href="../../../../../reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></li>
555 </ul>
556 </li>
557
558 </ul><br/>
559
560
561 </div><!-- end classes -->
562 </div><!-- end nav-panels -->
563 <div id="nav-tree" style="display:none" class="scroll-pane">
564 <div id="tree-list"></div>
565 </div><!-- end nav-tree -->
566 </div><!-- end swapper -->
567 <div id="nav-swap">
568 <a class="fullscreen">fullscreen</a>
569 <a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
570 </div>
571 </div> <!-- end devdoc-nav -->
572 </div> <!-- end side-nav -->
573 <script type="text/javascript">
574 // init fullscreen based on user pref
575 var fullscreen = readCookie("fullscreen");
576 if (fullscreen != 0) {
577 if (fullscreen == "false") {
578 toggleFullscreen(false);
579 } else {
580 toggleFullscreen(true);
581 }
582 }
583 // init nav version for mobile
584 if (isMobile) {
585 swapNav(); // tree view should be used on mobile
586 $('#nav-swap').hide();
587 } else {
588 chooseDefaultNav();
589 if ($("#nav-tree").is(':visible')) {
590 init_default_navtree("../../../../../");
591 }
592 }
593 // scroll the selected page into view
594 $(document).ready(function() {
595 scrollIntoView("packages-nav");
596 scrollIntoView("classes-nav");
597 });
598 </script>
599
600
601
602
603
604<div class="col-12" id="doc-col">
605
606<div id="api-info-block">
607
608
609
610
611
612
613
614
615
616
617
618<div class="sum-details-links">
619
620Summary:
621
622
623
624
625
626
627
628
629
630
631
632 <a href="#pubmethods">Methods</a>
633
634
635
636
637 &#124; <a href="#inhmethods">Inherited Methods</a>
638
639&#124; <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
640
641</div><!-- end sum-details-links -->
642<div class="api-level">
643
644
645
646
647</div>
648</div><!-- end api-info-block -->
649
650
651<!-- ======== START OF CLASS DATA ======== -->
652
653<div id="jd-header">
654 public
655
656
657
658 class
659<h1 itemprop="name">UiDevice</h1>
660
661
662
663
664 extends Object<br/>
665
666
667
668
669
670
671
672
673
674
675
676
677</div><!-- end header -->
678
679<div id="naMessage"></div>
680
681<div id="jd-content" class="api apilevel-">
682<table class="jd-inheritance-table">
683
684
685 <tr>
686
687 <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td>
688 </tr>
689
690
691 <tr>
692
693 <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;&#x21b3;</td>
694
695 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.uiautomator.UiDevice</td>
696 </tr>
697
698
699</table>
700
701
702
703
704
705
706
707<div class="jd-descr">
708
709
710<h2>Class Overview</h2>
711<p itemprop="articleBody">UiDevice provides access to state information about the device.
712 You can also use this class to simulate user actions on the device,
713 such as pressing the d-pad or pressing the Home and Menu buttons.</p>
714
715
716
717
718
719</div><!-- jd-descr -->
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736<div class="jd-descr">
737
738
739<h2>Summary</h2>
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767<!-- ========== METHOD SUMMARY =========== -->
768<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
769
770
771
772
773 <tr class="alt-color api apilevel-" >
774 <td class="jd-typecol"><nobr>
775
776
777
778
779
780 void</nobr>
781 </td>
782 <td class="jd-linkcol" width="100%"><nobr>
783 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#clearLastTraversedText()">clearLastTraversedText</a></span>()</nobr>
784
785 <div class="jd-descrdiv">
786 Clears the text from the last UI traversal event.
787
788
789
790 </div>
791
792 </td></tr>
793
794
795
796 <tr class=" api apilevel-" >
797 <td class="jd-typecol"><nobr>
798
799
800
801
802
803 boolean</nobr>
804 </td>
805 <td class="jd-linkcol" width="100%"><nobr>
806 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#click(int, int)">click</a></span>(int x, int y)</nobr>
807
808 <div class="jd-descrdiv">
809 Perform a click at arbitrary coordinates specified by the user
810
811
812
813 </div>
814
815 </td></tr>
816
817
818
819 <tr class="alt-color api apilevel-" >
820 <td class="jd-typecol"><nobr>
821
822
823
824
825
826 boolean</nobr>
827 </td>
828 <td class="jd-linkcol" width="100%"><nobr>
829 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#drag(int, int, int, int, int)">drag</a></span>(int startX, int startY, int endX, int endY, int steps)</nobr>
830
831 <div class="jd-descrdiv">
832 Performs a swipe from one coordinate to another coordinate.
833
834
835
836 </div>
837
838 </td></tr>
839
840
841
842 <tr class=" api apilevel-" >
843 <td class="jd-typecol"><nobr>
844
845
846
847
848
849 void</nobr>
850 </td>
851 <td class="jd-linkcol" width="100%"><nobr>
852 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#dumpWindowHierarchy(java.lang.String)">dumpWindowHierarchy</a></span>(String fileName)</nobr>
853
854 <div class="jd-descrdiv">
855 Helper method used for debugging to dump the current window's layout hierarchy.
856
857
858
859 </div>
860
861 </td></tr>
862
863
864
865 <tr class="alt-color api apilevel-" >
866 <td class="jd-typecol"><nobr>
867
868
869
870
871
872 <a href="../../../../../reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a></nobr>
873 </td>
874 <td class="jd-linkcol" width="100%"><nobr>
875 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#findObject(android.support.test.uiautomator.BySelector)">findObject</a></span>(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</nobr>
876
877 <div class="jd-descrdiv">
878 Returns the first object to match the <code>selector</code> criteria.
879
880
881
882 </div>
883
884 </td></tr>
885
886
887
888 <tr class=" api apilevel-" >
889 <td class="jd-typecol"><nobr>
890
891
892
893
894
895 <a href="../../../../../reference/android/support/test/uiautomator/UiObject.html">UiObject</a></nobr>
896 </td>
897 <td class="jd-linkcol" width="100%"><nobr>
898 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#findObject(android.support.test.uiautomator.UiSelector)">findObject</a></span>(<a href="../../../../../reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector)</nobr>
899
900 <div class="jd-descrdiv">
901 Returns a UiObject which represents a view that matches the specified selector criteria.
902
903
904
905 </div>
906
907 </td></tr>
908
909
910
911 <tr class="alt-color api apilevel-" >
912 <td class="jd-typecol"><nobr>
913
914
915
916
917
918 List&lt;<a href="../../../../../reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a>&gt;</nobr>
919 </td>
920 <td class="jd-linkcol" width="100%"><nobr>
921 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#findObjects(android.support.test.uiautomator.BySelector)">findObjects</a></span>(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</nobr>
922
923 <div class="jd-descrdiv">
924 Returns all objects that match the <code>selector</code> criteria.
925
926
927
928 </div>
929
930 </td></tr>
931
932
933
934 <tr class=" api apilevel-" >
935 <td class="jd-typecol"><nobr>
936
937
938
939
940
941 void</nobr>
942 </td>
943 <td class="jd-linkcol" width="100%"><nobr>
944 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#freezeRotation()">freezeRotation</a></span>()</nobr>
945
946 <div class="jd-descrdiv">
947 Disables the sensors and freezes the device rotation at its
948 current rotation state.
949
950
951
952 </div>
953
954 </td></tr>
955
956
957
958 <tr class="alt-color api apilevel-" >
959 <td class="jd-typecol"><nobr>
960
961
962
963
964
965 String</nobr>
966 </td>
967 <td class="jd-linkcol" width="100%"><nobr>
968 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getCurrentActivityName()">getCurrentActivityName</a></span>()</nobr>
969
970 <div class="jd-descrdiv">
971 <em>
972 This method is deprecated.
973 The results returned should be considered unreliable</em>
974
975
976
977 </div>
978
979 </td></tr>
980
981
982
983 <tr class=" api apilevel-" >
984 <td class="jd-typecol"><nobr>
985
986
987
988
989
990 String</nobr>
991 </td>
992 <td class="jd-linkcol" width="100%"><nobr>
993 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getCurrentPackageName()">getCurrentPackageName</a></span>()</nobr>
994
995 <div class="jd-descrdiv">
996 Retrieves the name of the last package to report accessibility events.
997
998
999
1000 </div>
1001
1002 </td></tr>
1003
1004
1005
1006 <tr class="alt-color api apilevel-" >
1007 <td class="jd-typecol"><nobr>
1008
1009
1010
1011
1012
1013 int</nobr>
1014 </td>
1015 <td class="jd-linkcol" width="100%"><nobr>
1016 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getDisplayHeight()">getDisplayHeight</a></span>()</nobr>
1017
1018 <div class="jd-descrdiv">
1019 Gets the height of the display, in pixels.
1020
1021
1022
1023 </div>
1024
1025 </td></tr>
1026
1027
1028
1029 <tr class=" api apilevel-" >
1030 <td class="jd-typecol"><nobr>
1031
1032
1033
1034
1035
1036 int</nobr>
1037 </td>
1038 <td class="jd-linkcol" width="100%"><nobr>
1039 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getDisplayRotation()">getDisplayRotation</a></span>()</nobr>
1040
1041 <div class="jd-descrdiv">
1042 Returns the current rotation of the display, as defined in <code><a href="../../../../../reference/android/view/Surface.html">Surface</a></code>
1043
1044
1045
1046 </div>
1047
1048 </td></tr>
1049
1050
1051
1052 <tr class="alt-color api apilevel-" >
1053 <td class="jd-typecol"><nobr>
1054
1055
1056
1057
1058
1059 Point</nobr>
1060 </td>
1061 <td class="jd-linkcol" width="100%"><nobr>
1062 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getDisplaySizeDp()">getDisplaySizeDp</a></span>()</nobr>
1063
1064 <div class="jd-descrdiv">
1065 Returns the display size in dp (device-independent pixel)
1066
1067 The returned display size is adjusted per screen rotation.
1068
1069
1070
1071 </div>
1072
1073 </td></tr>
1074
1075
1076
1077 <tr class=" api apilevel-" >
1078 <td class="jd-typecol"><nobr>
1079
1080
1081
1082
1083
1084 int</nobr>
1085 </td>
1086 <td class="jd-linkcol" width="100%"><nobr>
1087 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getDisplayWidth()">getDisplayWidth</a></span>()</nobr>
1088
1089 <div class="jd-descrdiv">
1090 Gets the width of the display, in pixels.
1091
1092
1093
1094 </div>
1095
1096 </td></tr>
1097
1098
1099
1100 <tr class="alt-color api apilevel-" >
1101 <td class="jd-typecol"><nobr>
1102
1103
1104
1105 static
1106
1107 <a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a></nobr>
1108 </td>
1109 <td class="jd-linkcol" width="100%"><nobr>
1110 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getInstance(android.app.Instrumentation)">getInstance</a></span>(Instrumentation instrumentation)</nobr>
1111
1112 <div class="jd-descrdiv">
1113 Retrieves a singleton instance of UiDevice
1114
1115
1116
1117 </div>
1118
1119 </td></tr>
1120
1121
1122
1123 <tr class=" api apilevel-" >
1124 <td class="jd-typecol"><nobr>
1125
1126
1127
1128 static
1129
1130 <a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a></nobr>
1131 </td>
1132 <td class="jd-linkcol" width="100%"><nobr>
1133 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getInstance()">getInstance</a></span>()</nobr>
1134
1135 <div class="jd-descrdiv">
1136 <em>
1137 This method is deprecated.
1138 Should use <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getInstance(android.app.Instrumentation)">getInstance(Instrumentation)</a></code> instead. This version hides
1139 UiDevice's dependency on having an Instrumentation reference and is prone to misuse.</em>
1140
1141
1142
1143 </div>
1144
1145 </td></tr>
1146
1147
1148
1149 <tr class="alt-color api apilevel-" >
1150 <td class="jd-typecol"><nobr>
1151
1152
1153
1154
1155
1156 String</nobr>
1157 </td>
1158 <td class="jd-linkcol" width="100%"><nobr>
1159 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getLastTraversedText()">getLastTraversedText</a></span>()</nobr>
1160
1161 <div class="jd-descrdiv">
1162 Retrieves the text from the last UI traversal event received.
1163
1164
1165
1166 </div>
1167
1168 </td></tr>
1169
1170
1171
1172 <tr class=" api apilevel-" >
1173 <td class="jd-typecol"><nobr>
1174
1175
1176
1177
1178
1179 String</nobr>
1180 </td>
1181 <td class="jd-linkcol" width="100%"><nobr>
1182 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getProductName()">getProductName</a></span>()</nobr>
1183
1184 <div class="jd-descrdiv">
1185 Retrieves the product name of the device.
1186
1187
1188
1189 </div>
1190
1191 </td></tr>
1192
1193
1194
1195 <tr class="alt-color api apilevel-" >
1196 <td class="jd-typecol"><nobr>
1197
1198
1199
1200
1201
1202 boolean</nobr>
1203 </td>
1204 <td class="jd-linkcol" width="100%"><nobr>
1205 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#hasAnyWatcherTriggered()">hasAnyWatcherTriggered</a></span>()</nobr>
1206
1207 <div class="jd-descrdiv">
1208 Checks if any registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> have triggered.
1209
1210
1211
1212 </div>
1213
1214 </td></tr>
1215
1216
1217
1218 <tr class=" api apilevel-" >
1219 <td class="jd-typecol"><nobr>
1220
1221
1222
1223
1224
1225 boolean</nobr>
1226 </td>
1227 <td class="jd-linkcol" width="100%"><nobr>
1228 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#hasObject(android.support.test.uiautomator.BySelector)">hasObject</a></span>(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</nobr>
1229
1230 <div class="jd-descrdiv">
1231 Returns whether there is a match for the given <code>selector</code> criteria.
1232
1233
1234
1235 </div>
1236
1237 </td></tr>
1238
1239
1240
1241 <tr class="alt-color api apilevel-" >
1242 <td class="jd-typecol"><nobr>
1243
1244
1245
1246
1247
1248 boolean</nobr>
1249 </td>
1250 <td class="jd-linkcol" width="100%"><nobr>
1251 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered</a></span>(String watcherName)</nobr>
1252
1253 <div class="jd-descrdiv">
1254 Checks if a specific registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> has triggered.
1255
1256
1257
1258 </div>
1259
1260 </td></tr>
1261
1262
1263
1264 <tr class=" api apilevel-" >
1265 <td class="jd-typecol"><nobr>
1266
1267
1268
1269
1270
1271 boolean</nobr>
1272 </td>
1273 <td class="jd-linkcol" width="100%"><nobr>
1274 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#isNaturalOrientation()">isNaturalOrientation</a></span>()</nobr>
1275
1276 <div class="jd-descrdiv">
1277 Check if the device is in its natural orientation.
1278
1279
1280
1281 </div>
1282
1283 </td></tr>
1284
1285
1286
1287 <tr class="alt-color api apilevel-" >
1288 <td class="jd-typecol"><nobr>
1289
1290
1291
1292
1293
1294 boolean</nobr>
1295 </td>
1296 <td class="jd-linkcol" width="100%"><nobr>
1297 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#isScreenOn()">isScreenOn</a></span>()</nobr>
1298
1299 <div class="jd-descrdiv">
1300 Checks the power manager if the screen is ON.
1301
1302
1303
1304 </div>
1305
1306 </td></tr>
1307
1308
1309
1310 <tr class=" api apilevel-" >
1311 <td class="jd-typecol"><nobr>
1312
1313
1314
1315
1316
1317 boolean</nobr>
1318 </td>
1319 <td class="jd-linkcol" width="100%"><nobr>
1320 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#openNotification()">openNotification</a></span>()</nobr>
1321
1322 <div class="jd-descrdiv">
1323 Opens the notification shade.
1324
1325
1326
1327 </div>
1328
1329 </td></tr>
1330
1331
1332
1333 <tr class="alt-color api apilevel-" >
1334 <td class="jd-typecol"><nobr>
1335
1336
1337
1338
1339
1340 boolean</nobr>
1341 </td>
1342 <td class="jd-linkcol" width="100%"><nobr>
1343 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#openQuickSettings()">openQuickSettings</a></span>()</nobr>
1344
1345 <div class="jd-descrdiv">
1346 Opens the Quick Settings shade.
1347
1348
1349
1350 </div>
1351
1352 </td></tr>
1353
1354
1355
1356 <tr class=" api apilevel-" >
1357 <td class="jd-typecol"><nobr>
1358
1359
1360
1361
1362 &lt;R&gt;
1363 R</nobr>
1364 </td>
1365 <td class="jd-linkcol" width="100%"><nobr>
1366 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#performActionAndWait(java.lang.Runnable, android.support.test.uiautomator.EventCondition<R>, long)">performActionAndWait</a></span>(Runnable action, <a href="../../../../../reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a>&lt;R&gt; condition, long timeout)</nobr>
1367
1368 <div class="jd-descrdiv">
1369 Performs the provided <code>action</code> and waits for the <code>condition</code> to be met.
1370
1371
1372
1373 </div>
1374
1375 </td></tr>
1376
1377
1378
1379 <tr class="alt-color api apilevel-" >
1380 <td class="jd-typecol"><nobr>
1381
1382
1383
1384
1385
1386 boolean</nobr>
1387 </td>
1388 <td class="jd-linkcol" width="100%"><nobr>
1389 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressBack()">pressBack</a></span>()</nobr>
1390
1391 <div class="jd-descrdiv">
1392 Simulates a short press on the BACK button.
1393
1394
1395
1396 </div>
1397
1398 </td></tr>
1399
1400
1401
1402 <tr class=" api apilevel-" >
1403 <td class="jd-typecol"><nobr>
1404
1405
1406
1407
1408
1409 boolean</nobr>
1410 </td>
1411 <td class="jd-linkcol" width="100%"><nobr>
1412 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDPadCenter()">pressDPadCenter</a></span>()</nobr>
1413
1414 <div class="jd-descrdiv">
1415 Simulates a short press on the CENTER button.
1416
1417
1418
1419 </div>
1420
1421 </td></tr>
1422
1423
1424
1425 <tr class="alt-color api apilevel-" >
1426 <td class="jd-typecol"><nobr>
1427
1428
1429
1430
1431
1432 boolean</nobr>
1433 </td>
1434 <td class="jd-linkcol" width="100%"><nobr>
1435 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDPadDown()">pressDPadDown</a></span>()</nobr>
1436
1437 <div class="jd-descrdiv">
1438 Simulates a short press on the DOWN button.
1439
1440
1441
1442 </div>
1443
1444 </td></tr>
1445
1446
1447
1448 <tr class=" api apilevel-" >
1449 <td class="jd-typecol"><nobr>
1450
1451
1452
1453
1454
1455 boolean</nobr>
1456 </td>
1457 <td class="jd-linkcol" width="100%"><nobr>
1458 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDPadLeft()">pressDPadLeft</a></span>()</nobr>
1459
1460 <div class="jd-descrdiv">
1461 Simulates a short press on the LEFT button.
1462
1463
1464
1465 </div>
1466
1467 </td></tr>
1468
1469
1470
1471 <tr class="alt-color api apilevel-" >
1472 <td class="jd-typecol"><nobr>
1473
1474
1475
1476
1477
1478 boolean</nobr>
1479 </td>
1480 <td class="jd-linkcol" width="100%"><nobr>
1481 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDPadRight()">pressDPadRight</a></span>()</nobr>
1482
1483 <div class="jd-descrdiv">
1484 Simulates a short press on the RIGHT button.
1485
1486
1487
1488 </div>
1489
1490 </td></tr>
1491
1492
1493
1494 <tr class=" api apilevel-" >
1495 <td class="jd-typecol"><nobr>
1496
1497
1498
1499
1500
1501 boolean</nobr>
1502 </td>
1503 <td class="jd-linkcol" width="100%"><nobr>
1504 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDPadUp()">pressDPadUp</a></span>()</nobr>
1505
1506 <div class="jd-descrdiv">
1507 Simulates a short press on the UP button.
1508
1509
1510
1511 </div>
1512
1513 </td></tr>
1514
1515
1516
1517 <tr class="alt-color api apilevel-" >
1518 <td class="jd-typecol"><nobr>
1519
1520
1521
1522
1523
1524 boolean</nobr>
1525 </td>
1526 <td class="jd-linkcol" width="100%"><nobr>
1527 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressDelete()">pressDelete</a></span>()</nobr>
1528
1529 <div class="jd-descrdiv">
1530 Simulates a short press on the DELETE key.
1531
1532
1533
1534 </div>
1535
1536 </td></tr>
1537
1538
1539
1540 <tr class=" api apilevel-" >
1541 <td class="jd-typecol"><nobr>
1542
1543
1544
1545
1546
1547 boolean</nobr>
1548 </td>
1549 <td class="jd-linkcol" width="100%"><nobr>
1550 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressEnter()">pressEnter</a></span>()</nobr>
1551
1552 <div class="jd-descrdiv">
1553 Simulates a short press on the ENTER key.
1554
1555
1556
1557 </div>
1558
1559 </td></tr>
1560
1561
1562
1563 <tr class="alt-color api apilevel-" >
1564 <td class="jd-typecol"><nobr>
1565
1566
1567
1568
1569
1570 boolean</nobr>
1571 </td>
1572 <td class="jd-linkcol" width="100%"><nobr>
1573 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressHome()">pressHome</a></span>()</nobr>
1574
1575 <div class="jd-descrdiv">
1576 Simulates a short press on the HOME button.
1577
1578
1579
1580 </div>
1581
1582 </td></tr>
1583
1584
1585
1586 <tr class=" api apilevel-" >
1587 <td class="jd-typecol"><nobr>
1588
1589
1590
1591
1592
1593 boolean</nobr>
1594 </td>
1595 <td class="jd-linkcol" width="100%"><nobr>
1596 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressKeyCode(int, int)">pressKeyCode</a></span>(int keyCode, int metaState)</nobr>
1597
1598 <div class="jd-descrdiv">
1599 Simulates a short press using a key code.
1600
1601
1602
1603 </div>
1604
1605 </td></tr>
1606
1607
1608
1609 <tr class="alt-color api apilevel-" >
1610 <td class="jd-typecol"><nobr>
1611
1612
1613
1614
1615
1616 boolean</nobr>
1617 </td>
1618 <td class="jd-linkcol" width="100%"><nobr>
1619 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressKeyCode(int)">pressKeyCode</a></span>(int keyCode)</nobr>
1620
1621 <div class="jd-descrdiv">
1622 Simulates a short press using a key code.
1623
1624
1625
1626 </div>
1627
1628 </td></tr>
1629
1630
1631
1632 <tr class=" api apilevel-" >
1633 <td class="jd-typecol"><nobr>
1634
1635
1636
1637
1638
1639 boolean</nobr>
1640 </td>
1641 <td class="jd-linkcol" width="100%"><nobr>
1642 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressMenu()">pressMenu</a></span>()</nobr>
1643
1644 <div class="jd-descrdiv">
1645 Simulates a short press on the MENU button.
1646
1647
1648
1649 </div>
1650
1651 </td></tr>
1652
1653
1654
1655 <tr class="alt-color api apilevel-" >
1656 <td class="jd-typecol"><nobr>
1657
1658
1659
1660
1661
1662 boolean</nobr>
1663 </td>
1664 <td class="jd-linkcol" width="100%"><nobr>
1665 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressRecentApps()">pressRecentApps</a></span>()</nobr>
1666
1667 <div class="jd-descrdiv">
1668 Simulates a short press on the Recent Apps button.
1669
1670
1671
1672 </div>
1673
1674 </td></tr>
1675
1676
1677
1678 <tr class=" api apilevel-" >
1679 <td class="jd-typecol"><nobr>
1680
1681
1682
1683
1684
1685 boolean</nobr>
1686 </td>
1687 <td class="jd-linkcol" width="100%"><nobr>
1688 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#pressSearch()">pressSearch</a></span>()</nobr>
1689
1690 <div class="jd-descrdiv">
1691 Simulates a short press on the SEARCH button.
1692
1693
1694
1695 </div>
1696
1697 </td></tr>
1698
1699
1700
1701 <tr class="alt-color api apilevel-" >
1702 <td class="jd-typecol"><nobr>
1703
1704
1705
1706
1707
1708 void</nobr>
1709 </td>
1710 <td class="jd-linkcol" width="100%"><nobr>
1711 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher</a></span>(String name, <a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a> watcher)</nobr>
1712
1713 <div class="jd-descrdiv">
1714 Registers a <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to
1715 find a match using a <code><a href="../../../../../reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code>.
1716
1717
1718
1719 </div>
1720
1721 </td></tr>
1722
1723
1724
1725 <tr class=" api apilevel-" >
1726 <td class="jd-typecol"><nobr>
1727
1728
1729
1730
1731
1732 void</nobr>
1733 </td>
1734 <td class="jd-linkcol" width="100%"><nobr>
1735 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#removeWatcher(java.lang.String)">removeWatcher</a></span>(String name)</nobr>
1736
1737 <div class="jd-descrdiv">
1738 Removes a previously registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code>.
1739
1740
1741
1742 </div>
1743
1744 </td></tr>
1745
1746
1747
1748 <tr class="alt-color api apilevel-" >
1749 <td class="jd-typecol"><nobr>
1750
1751
1752
1753
1754
1755 void</nobr>
1756 </td>
1757 <td class="jd-linkcol" width="100%"><nobr>
1758 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#resetWatcherTriggers()">resetWatcherTriggers</a></span>()</nobr>
1759
1760 <div class="jd-descrdiv">
1761 Resets a <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> that has been triggered.
1762
1763
1764
1765 </div>
1766
1767 </td></tr>
1768
1769
1770
1771 <tr class=" api apilevel-" >
1772 <td class="jd-typecol"><nobr>
1773
1774
1775
1776
1777
1778 void</nobr>
1779 </td>
1780 <td class="jd-linkcol" width="100%"><nobr>
1781 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#runWatchers()">runWatchers</a></span>()</nobr>
1782
1783 <div class="jd-descrdiv">
1784 This method forces all registered watchers to run.
1785
1786
1787
1788 </div>
1789
1790 </td></tr>
1791
1792
1793
1794 <tr class="alt-color api apilevel-" >
1795 <td class="jd-typecol"><nobr>
1796
1797
1798
1799
1800
1801 void</nobr>
1802 </td>
1803 <td class="jd-linkcol" width="100%"><nobr>
1804 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#setCompressedLayoutHeirarchy(boolean)">setCompressedLayoutHeirarchy</a></span>(boolean compressed)</nobr>
1805
1806 <div class="jd-descrdiv">
1807 Enables or disables layout hierarchy compression.
1808
1809
1810
1811 </div>
1812
1813 </td></tr>
1814
1815
1816
1817 <tr class=" api apilevel-" >
1818 <td class="jd-typecol"><nobr>
1819
1820
1821
1822
1823
1824 void</nobr>
1825 </td>
1826 <td class="jd-linkcol" width="100%"><nobr>
1827 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#setOrientationLeft()">setOrientationLeft</a></span>()</nobr>
1828
1829 <div class="jd-descrdiv">
1830 Simulates orienting the device to the left and also freezes rotation
1831 by disabling the sensors.
1832
1833
1834
1835 </div>
1836
1837 </td></tr>
1838
1839
1840
1841 <tr class="alt-color api apilevel-" >
1842 <td class="jd-typecol"><nobr>
1843
1844
1845
1846
1847
1848 void</nobr>
1849 </td>
1850 <td class="jd-linkcol" width="100%"><nobr>
1851 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#setOrientationNatural()">setOrientationNatural</a></span>()</nobr>
1852
1853 <div class="jd-descrdiv">
1854 Simulates orienting the device into its natural orientation and also freezes rotation
1855 by disabling the sensors.
1856
1857
1858
1859 </div>
1860
1861 </td></tr>
1862
1863
1864
1865 <tr class=" api apilevel-" >
1866 <td class="jd-typecol"><nobr>
1867
1868
1869
1870
1871
1872 void</nobr>
1873 </td>
1874 <td class="jd-linkcol" width="100%"><nobr>
1875 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#setOrientationRight()">setOrientationRight</a></span>()</nobr>
1876
1877 <div class="jd-descrdiv">
1878 Simulates orienting the device to the right and also freezes rotation
1879 by disabling the sensors.
1880
1881
1882
1883 </div>
1884
1885 </td></tr>
1886
1887
1888
1889 <tr class="alt-color api apilevel-" >
1890 <td class="jd-typecol"><nobr>
1891
1892
1893
1894
1895
1896 void</nobr>
1897 </td>
1898 <td class="jd-linkcol" width="100%"><nobr>
1899 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#sleep()">sleep</a></span>()</nobr>
1900
1901 <div class="jd-descrdiv">
1902 This method simply presses the power button if the screen is ON else
1903 it does nothing if the screen is already OFF.
1904
1905
1906
1907 </div>
1908
1909 </td></tr>
1910
1911
1912
1913 <tr class=" api apilevel-" >
1914 <td class="jd-typecol"><nobr>
1915
1916
1917
1918
1919
1920 boolean</nobr>
1921 </td>
1922 <td class="jd-linkcol" width="100%"><nobr>
1923 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#swipe(android.graphics.Point[], int)">swipe</a></span>(Point[] segments, int segmentSteps)</nobr>
1924
1925 <div class="jd-descrdiv">
1926 Performs a swipe between points in the Point array.
1927
1928
1929
1930 </div>
1931
1932 </td></tr>
1933
1934
1935
1936 <tr class="alt-color api apilevel-" >
1937 <td class="jd-typecol"><nobr>
1938
1939
1940
1941
1942
1943 boolean</nobr>
1944 </td>
1945 <td class="jd-linkcol" width="100%"><nobr>
1946 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#swipe(int, int, int, int, int)">swipe</a></span>(int startX, int startY, int endX, int endY, int steps)</nobr>
1947
1948 <div class="jd-descrdiv">
1949 Performs a swipe from one coordinate to another using the number of steps
1950 to determine smoothness and speed.
1951
1952
1953
1954 </div>
1955
1956 </td></tr>
1957
1958
1959
1960 <tr class=" api apilevel-" >
1961 <td class="jd-typecol"><nobr>
1962
1963
1964
1965
1966
1967 boolean</nobr>
1968 </td>
1969 <td class="jd-linkcol" width="100%"><nobr>
1970 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#takeScreenshot(java.io.File)">takeScreenshot</a></span>(File storePath)</nobr>
1971
1972 <div class="jd-descrdiv">
1973 Take a screenshot of current window and store it as PNG
1974
1975 Default scale of 1.0f (original size) and 90% quality is used
1976 The screenshot is adjusted per screen rotation
1977
1978
1979
1980 </div>
1981
1982 </td></tr>
1983
1984
1985
1986 <tr class="alt-color api apilevel-" >
1987 <td class="jd-typecol"><nobr>
1988
1989
1990
1991
1992
1993 boolean</nobr>
1994 </td>
1995 <td class="jd-linkcol" width="100%"><nobr>
1996 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#takeScreenshot(java.io.File, float, int)">takeScreenshot</a></span>(File storePath, float scale, int quality)</nobr>
1997
1998 <div class="jd-descrdiv">
1999 Take a screenshot of current window and store it as PNG
2000
2001 The screenshot is adjusted per screen rotation
2002
2003
2004
2005 </div>
2006
2007 </td></tr>
2008
2009
2010
2011 <tr class=" api apilevel-" >
2012 <td class="jd-typecol"><nobr>
2013
2014
2015
2016
2017
2018 void</nobr>
2019 </td>
2020 <td class="jd-linkcol" width="100%"><nobr>
2021 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#unfreezeRotation()">unfreezeRotation</a></span>()</nobr>
2022
2023 <div class="jd-descrdiv">
2024 Re-enables the sensors and un-freezes the device rotation allowing its contents
2025 to rotate with the device physical rotation.
2026
2027
2028
2029 </div>
2030
2031 </td></tr>
2032
2033
2034
2035 <tr class="alt-color api apilevel-" >
2036 <td class="jd-typecol"><nobr>
2037
2038
2039
2040
2041 &lt;R&gt;
2042 R</nobr>
2043 </td>
2044 <td class="jd-linkcol" width="100%"><nobr>
2045 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#wait(android.support.test.uiautomator.SearchCondition<R>, long)">wait</a></span>(<a href="../../../../../reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a>&lt;R&gt; condition, long timeout)</nobr>
2046
2047 <div class="jd-descrdiv">
2048 Waits for given the <code>condition</code> to be met.
2049
2050
2051
2052 </div>
2053
2054 </td></tr>
2055
2056
2057
2058 <tr class=" api apilevel-" >
2059 <td class="jd-typecol"><nobr>
2060
2061
2062
2063
2064
2065 void</nobr>
2066 </td>
2067 <td class="jd-linkcol" width="100%"><nobr>
2068 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#waitForIdle(long)">waitForIdle</a></span>(long timeout)</nobr>
2069
2070 <div class="jd-descrdiv">
2071 Waits for the current application to idle.
2072
2073
2074
2075 </div>
2076
2077 </td></tr>
2078
2079
2080
2081 <tr class="alt-color api apilevel-" >
2082 <td class="jd-typecol"><nobr>
2083
2084
2085
2086
2087
2088 void</nobr>
2089 </td>
2090 <td class="jd-linkcol" width="100%"><nobr>
2091 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#waitForIdle()">waitForIdle</a></span>()</nobr>
2092
2093 <div class="jd-descrdiv">
2094 Waits for the current application to idle.
2095
2096
2097
2098 </div>
2099
2100 </td></tr>
2101
2102
2103
2104 <tr class=" api apilevel-" >
2105 <td class="jd-typecol"><nobr>
2106
2107
2108
2109
2110
2111 boolean</nobr>
2112 </td>
2113 <td class="jd-linkcol" width="100%"><nobr>
2114 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#waitForWindowUpdate(java.lang.String, long)">waitForWindowUpdate</a></span>(String packageName, long timeout)</nobr>
2115
2116 <div class="jd-descrdiv">
2117 Waits for a window content update event to occur.
2118
2119
2120
2121 </div>
2122
2123 </td></tr>
2124
2125
2126
2127 <tr class="alt-color api apilevel-" >
2128 <td class="jd-typecol"><nobr>
2129
2130
2131
2132
2133
2134 void</nobr>
2135 </td>
2136 <td class="jd-linkcol" width="100%"><nobr>
2137 <span class="sympad"><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#wakeUp()">wakeUp</a></span>()</nobr>
2138
2139 <div class="jd-descrdiv">
2140 This method simulates pressing the power button if the screen is OFF else
2141 it does nothing if the screen is already ON.
2142
2143
2144
2145 </div>
2146
2147 </td></tr>
2148
2149
2150
2151</table>
2152
2153
2154
2155
2156
2157
2158
2159<!-- ========== METHOD SUMMARY =========== -->
2160<table id="inhmethods" class="jd-sumtable"><tr><th>
2161 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
2162 <div style="clear:left;">Inherited Methods</div></th></tr>
2163
2164
2165<tr class="api apilevel-" >
2166<td colspan="12">
2167 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
2168 ><img id="inherited-methods-java.lang.Object-trigger"
2169 src="../../../../../assets/images/triangle-closed.png"
2170 class="jd-expando-trigger-img" /></a>
2171From class
2172
2173 java.lang.Object
2174
2175<div id="inherited-methods-java.lang.Object">
2176 <div id="inherited-methods-java.lang.Object-list"
2177 class="jd-inheritedlinks">
2178 </div>
2179 <div id="inherited-methods-java.lang.Object-summary" style="display: none;">
2180 <table class="jd-sumtable-expando">
2181
2182
2183
2184
2185 <tr class="alt-color api apilevel-" >
2186 <td class="jd-typecol"><nobr>
2187
2188
2189
2190
2191
2192 Object</nobr>
2193 </td>
2194 <td class="jd-linkcol" width="100%"><nobr>
2195 <span class="sympad">clone</span>()</nobr>
2196
2197 </td></tr>
2198
2199
2200
2201 <tr class=" api apilevel-" >
2202 <td class="jd-typecol"><nobr>
2203
2204
2205
2206
2207
2208 boolean</nobr>
2209 </td>
2210 <td class="jd-linkcol" width="100%"><nobr>
2211 <span class="sympad">equals</span>(Object arg0)</nobr>
2212
2213 </td></tr>
2214
2215
2216
2217 <tr class="alt-color api apilevel-" >
2218 <td class="jd-typecol"><nobr>
2219
2220
2221
2222
2223
2224 void</nobr>
2225 </td>
2226 <td class="jd-linkcol" width="100%"><nobr>
2227 <span class="sympad">finalize</span>()</nobr>
2228
2229 </td></tr>
2230
2231
2232
2233 <tr class=" api apilevel-" >
2234 <td class="jd-typecol"><nobr>
2235
2236
2237 final
2238
2239
2240 Class&lt;?&gt;</nobr>
2241 </td>
2242 <td class="jd-linkcol" width="100%"><nobr>
2243 <span class="sympad">getClass</span>()</nobr>
2244
2245 </td></tr>
2246
2247
2248
2249 <tr class="alt-color api apilevel-" >
2250 <td class="jd-typecol"><nobr>
2251
2252
2253
2254
2255
2256 int</nobr>
2257 </td>
2258 <td class="jd-linkcol" width="100%"><nobr>
2259 <span class="sympad">hashCode</span>()</nobr>
2260
2261 </td></tr>
2262
2263
2264
2265 <tr class=" api apilevel-" >
2266 <td class="jd-typecol"><nobr>
2267
2268
2269 final
2270
2271
2272 void</nobr>
2273 </td>
2274 <td class="jd-linkcol" width="100%"><nobr>
2275 <span class="sympad">notify</span>()</nobr>
2276
2277 </td></tr>
2278
2279
2280
2281 <tr class="alt-color api apilevel-" >
2282 <td class="jd-typecol"><nobr>
2283
2284
2285 final
2286
2287
2288 void</nobr>
2289 </td>
2290 <td class="jd-linkcol" width="100%"><nobr>
2291 <span class="sympad">notifyAll</span>()</nobr>
2292
2293 </td></tr>
2294
2295
2296
2297 <tr class=" api apilevel-" >
2298 <td class="jd-typecol"><nobr>
2299
2300
2301
2302
2303
2304 String</nobr>
2305 </td>
2306 <td class="jd-linkcol" width="100%"><nobr>
2307 <span class="sympad">toString</span>()</nobr>
2308
2309 </td></tr>
2310
2311
2312
2313 <tr class="alt-color api apilevel-" >
2314 <td class="jd-typecol"><nobr>
2315
2316
2317 final
2318
2319
2320 void</nobr>
2321 </td>
2322 <td class="jd-linkcol" width="100%"><nobr>
2323 <span class="sympad">wait</span>()</nobr>
2324
2325 </td></tr>
2326
2327
2328
2329 <tr class=" api apilevel-" >
2330 <td class="jd-typecol"><nobr>
2331
2332
2333 final
2334
2335
2336 void</nobr>
2337 </td>
2338 <td class="jd-linkcol" width="100%"><nobr>
2339 <span class="sympad">wait</span>(long arg0, int arg1)</nobr>
2340
2341 </td></tr>
2342
2343
2344
2345 <tr class="alt-color api apilevel-" >
2346 <td class="jd-typecol"><nobr>
2347
2348
2349 final
2350
2351
2352 void</nobr>
2353 </td>
2354 <td class="jd-linkcol" width="100%"><nobr>
2355 <span class="sympad">wait</span>(long arg0)</nobr>
2356
2357 </td></tr>
2358
2359
2360</table>
2361 </div>
2362</div>
2363</td></tr>
2364
2365
2366</table>
2367
2368
2369</div><!-- jd-descr (summary) -->
2370
2371<!-- Details -->
2372
2373
2374
2375
2376
2377
2378
2379
2380<!-- XML Attributes -->
2381
2382
2383<!-- Enum Values -->
2384
2385
2386<!-- Constants -->
2387
2388
2389<!-- Fields -->
2390
2391
2392<!-- Public ctors -->
2393
2394
2395
2396<!-- ========= CONSTRUCTOR DETAIL ======== -->
2397<!-- Protected ctors -->
2398
2399
2400
2401<!-- ========= METHOD DETAIL ======== -->
2402<!-- Public methdos -->
2403
2404<h2>Public Methods</h2>
2405
2406
2407
2408<A NAME="clearLastTraversedText()"></A>
2409
2410<div class="jd-details api apilevel-">
2411 <h4 class="jd-details-title">
2412 <span class="normal">
2413 public
2414
2415
2416
2417
2418 void
2419 </span>
2420 <span class="sympad">clearLastTraversedText</span>
2421 <span class="normal">()</span>
2422 </h4>
2423 <div class="api-level">
2424 <div></div>
2425
2426
2427
2428 </div>
2429 <div class="jd-details-descr">
2430
2431
2432
2433
2434 <div class="jd-tagdata jd-tagdescr"><p>Clears the text from the last UI traversal event.
2435 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getLastTraversedText()">getLastTraversedText()</a></code>.</p></div>
2436
2437 </div>
2438</div>
2439
2440
2441<A NAME="click(int, int)"></A>
2442
2443<div class="jd-details api apilevel-">
2444 <h4 class="jd-details-title">
2445 <span class="normal">
2446 public
2447
2448
2449
2450
2451 boolean
2452 </span>
2453 <span class="sympad">click</span>
2454 <span class="normal">(int x, int y)</span>
2455 </h4>
2456 <div class="api-level">
2457 <div></div>
2458
2459
2460
2461 </div>
2462 <div class="jd-details-descr">
2463
2464
2465
2466
2467 <div class="jd-tagdata jd-tagdescr"><p>Perform a click at arbitrary coordinates specified by the user</p></div>
2468 <div class="jd-tagdata">
2469 <h5 class="jd-tagtitle">Parameters</h5>
2470 <table class="jd-tagtable">
2471 <tr>
2472 <th>x</td>
2473 <td>coordinate</td>
2474 </tr>
2475 <tr>
2476 <th>y</td>
2477 <td>coordinate</td>
2478 </tr>
2479 </table>
2480 </div>
2481 <div class="jd-tagdata">
2482 <h5 class="jd-tagtitle">Returns</h5>
2483 <ul class="nolist"><li>true if the click succeeded else false</li></ul>
2484 </div>
2485
2486 </div>
2487</div>
2488
2489
2490<A NAME="drag(int, int, int, int, int)"></A>
2491
2492<div class="jd-details api apilevel-">
2493 <h4 class="jd-details-title">
2494 <span class="normal">
2495 public
2496
2497
2498
2499
2500 boolean
2501 </span>
2502 <span class="sympad">drag</span>
2503 <span class="normal">(int startX, int startY, int endX, int endY, int steps)</span>
2504 </h4>
2505 <div class="api-level">
2506 <div></div>
2507
2508
2509
2510 </div>
2511 <div class="jd-details-descr">
2512
2513
2514
2515
2516 <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe from one coordinate to another coordinate. You can control
2517 the smoothness and speed of the swipe by specifying the number of steps.
2518 Each step execution is throttled to 5 milliseconds per step, so for a 100
2519 steps, the swipe will take around 0.5 seconds to complete.</p></div>
2520 <div class="jd-tagdata">
2521 <h5 class="jd-tagtitle">Parameters</h5>
2522 <table class="jd-tagtable">
2523 <tr>
2524 <th>startX</td>
2525 <td>X-axis value for the starting coordinate</td>
2526 </tr>
2527 <tr>
2528 <th>startY</td>
2529 <td>Y-axis value for the starting coordinate</td>
2530 </tr>
2531 <tr>
2532 <th>endX</td>
2533 <td>X-axis value for the ending coordinate</td>
2534 </tr>
2535 <tr>
2536 <th>endY</td>
2537 <td>Y-axis value for the ending coordinate</td>
2538 </tr>
2539 <tr>
2540 <th>steps</td>
2541 <td>is the number of steps for the swipe action</td>
2542 </tr>
2543 </table>
2544 </div>
2545 <div class="jd-tagdata">
2546 <h5 class="jd-tagtitle">Returns</h5>
2547 <ul class="nolist"><li>true if swipe is performed, false if the operation fails
2548 or the coordinates are invalid</li></ul>
2549 </div>
2550
2551 </div>
2552</div>
2553
2554
2555<A NAME="dumpWindowHierarchy(java.lang.String)"></A>
2556
2557<div class="jd-details api apilevel-">
2558 <h4 class="jd-details-title">
2559 <span class="normal">
2560 public
2561
2562
2563
2564
2565 void
2566 </span>
2567 <span class="sympad">dumpWindowHierarchy</span>
2568 <span class="normal">(String fileName)</span>
2569 </h4>
2570 <div class="api-level">
2571 <div></div>
2572
2573
2574
2575 </div>
2576 <div class="jd-details-descr">
2577
2578
2579
2580
2581 <div class="jd-tagdata jd-tagdescr"><p>Helper method used for debugging to dump the current window's layout hierarchy.
2582 Relative file paths are stored the application's internal private storage location.</p></div>
2583
2584 </div>
2585</div>
2586
2587
2588<A NAME="findObject(android.support.test.uiautomator.BySelector)"></A>
2589
2590<div class="jd-details api apilevel-">
2591 <h4 class="jd-details-title">
2592 <span class="normal">
2593 public
2594
2595
2596
2597
2598 <a href="../../../../../reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a>
2599 </span>
2600 <span class="sympad">findObject</span>
2601 <span class="normal">(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</span>
2602 </h4>
2603 <div class="api-level">
2604 <div></div>
2605
2606
2607
2608 </div>
2609 <div class="jd-details-descr">
2610
2611
2612
2613
2614 <div class="jd-tagdata jd-tagdescr"><p>Returns the first object to match the <code>selector</code> criteria. </p></div>
2615
2616 </div>
2617</div>
2618
2619
2620<A NAME="findObject(android.support.test.uiautomator.UiSelector)"></A>
2621
2622<div class="jd-details api apilevel-">
2623 <h4 class="jd-details-title">
2624 <span class="normal">
2625 public
2626
2627
2628
2629
2630 <a href="../../../../../reference/android/support/test/uiautomator/UiObject.html">UiObject</a>
2631 </span>
2632 <span class="sympad">findObject</span>
2633 <span class="normal">(<a href="../../../../../reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector)</span>
2634 </h4>
2635 <div class="api-level">
2636 <div></div>
2637
2638
2639
2640 </div>
2641 <div class="jd-details-descr">
2642
2643
2644
2645
2646 <div class="jd-tagdata jd-tagdescr"><p>Returns a UiObject which represents a view that matches the specified selector criteria.</p></div>
2647 <div class="jd-tagdata">
2648 <h5 class="jd-tagtitle">Returns</h5>
2649 <ul class="nolist"><li>UiObject object
2650</li></ul>
2651 </div>
2652
2653 </div>
2654</div>
2655
2656
2657<A NAME="findObjects(android.support.test.uiautomator.BySelector)"></A>
2658
2659<div class="jd-details api apilevel-">
2660 <h4 class="jd-details-title">
2661 <span class="normal">
2662 public
2663
2664
2665
2666
2667 List&lt;<a href="../../../../../reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a>&gt;
2668 </span>
2669 <span class="sympad">findObjects</span>
2670 <span class="normal">(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</span>
2671 </h4>
2672 <div class="api-level">
2673 <div></div>
2674
2675
2676
2677 </div>
2678 <div class="jd-details-descr">
2679
2680
2681
2682
2683 <div class="jd-tagdata jd-tagdescr"><p>Returns all objects that match the <code>selector</code> criteria. </p></div>
2684
2685 </div>
2686</div>
2687
2688
2689<A NAME="freezeRotation()"></A>
2690
2691<div class="jd-details api apilevel-">
2692 <h4 class="jd-details-title">
2693 <span class="normal">
2694 public
2695
2696
2697
2698
2699 void
2700 </span>
2701 <span class="sympad">freezeRotation</span>
2702 <span class="normal">()</span>
2703 </h4>
2704 <div class="api-level">
2705 <div></div>
2706
2707
2708
2709 </div>
2710 <div class="jd-details-descr">
2711
2712
2713
2714
2715 <div class="jd-tagdata jd-tagdescr"><p>Disables the sensors and freezes the device rotation at its
2716 current rotation state.</p></div>
2717 <div class="jd-tagdata">
2718 <h5 class="jd-tagtitle">Throws</h5>
2719 <table class="jd-tagtable">
2720 <tr>
2721 <th></td>
2722 <td>RemoteException</td>
2723 </tr>
2724 <tr>
2725 <th>RemoteException</td>
2726 <td></td>
2727 </tr>
2728 </table>
2729 </div>
2730
2731 </div>
2732</div>
2733
2734
2735<A NAME="getCurrentActivityName()"></A>
2736
2737<div class="jd-details api apilevel-">
2738 <h4 class="jd-details-title">
2739 <span class="normal">
2740 public
2741
2742
2743
2744
2745 String
2746 </span>
2747 <span class="sympad">getCurrentActivityName</span>
2748 <span class="normal">()</span>
2749 </h4>
2750 <div class="api-level">
2751 <div></div>
2752
2753
2754
2755 </div>
2756 <div class="jd-details-descr">
2757
2758
2759
2760 <p>
2761 <p class="caution"><strong>
2762 This method is deprecated.</strong><br/>
2763 The results returned should be considered unreliable
2764 </p>
2765 <div class="jd-tagdata jd-tagdescr"><p>Retrieves the last activity to report accessibility events.</p></div>
2766 <div class="jd-tagdata">
2767 <h5 class="jd-tagtitle">Returns</h5>
2768 <ul class="nolist"><li>String name of activity</li></ul>
2769 </div>
2770
2771 </div>
2772</div>
2773
2774
2775<A NAME="getCurrentPackageName()"></A>
2776
2777<div class="jd-details api apilevel-">
2778 <h4 class="jd-details-title">
2779 <span class="normal">
2780 public
2781
2782
2783
2784
2785 String
2786 </span>
2787 <span class="sympad">getCurrentPackageName</span>
2788 <span class="normal">()</span>
2789 </h4>
2790 <div class="api-level">
2791 <div></div>
2792
2793
2794
2795 </div>
2796 <div class="jd-details-descr">
2797
2798
2799
2800
2801 <div class="jd-tagdata jd-tagdescr"><p>Retrieves the name of the last package to report accessibility events.</p></div>
2802 <div class="jd-tagdata">
2803 <h5 class="jd-tagtitle">Returns</h5>
2804 <ul class="nolist"><li>String name of package</li></ul>
2805 </div>
2806
2807 </div>
2808</div>
2809
2810
2811<A NAME="getDisplayHeight()"></A>
2812
2813<div class="jd-details api apilevel-">
2814 <h4 class="jd-details-title">
2815 <span class="normal">
2816 public
2817
2818
2819
2820
2821 int
2822 </span>
2823 <span class="sympad">getDisplayHeight</span>
2824 <span class="normal">()</span>
2825 </h4>
2826 <div class="api-level">
2827 <div></div>
2828
2829
2830
2831 </div>
2832 <div class="jd-details-descr">
2833
2834
2835
2836
2837 <div class="jd-tagdata jd-tagdescr"><p>Gets the height of the display, in pixels. The size is adjusted based
2838 on the current orientation of the display.</p></div>
2839 <div class="jd-tagdata">
2840 <h5 class="jd-tagtitle">Returns</h5>
2841 <ul class="nolist"><li>height in pixels or zero on failure</li></ul>
2842 </div>
2843
2844 </div>
2845</div>
2846
2847
2848<A NAME="getDisplayRotation()"></A>
2849
2850<div class="jd-details api apilevel-">
2851 <h4 class="jd-details-title">
2852 <span class="normal">
2853 public
2854
2855
2856
2857
2858 int
2859 </span>
2860 <span class="sympad">getDisplayRotation</span>
2861 <span class="normal">()</span>
2862 </h4>
2863 <div class="api-level">
2864 <div></div>
2865
2866
2867
2868 </div>
2869 <div class="jd-details-descr">
2870
2871
2872
2873
2874 <div class="jd-tagdata jd-tagdescr"><p>Returns the current rotation of the display, as defined in <code><a href="../../../../../reference/android/view/Surface.html">Surface</a></code></p></div>
2875
2876 </div>
2877</div>
2878
2879
2880<A NAME="getDisplaySizeDp()"></A>
2881
2882<div class="jd-details api apilevel-">
2883 <h4 class="jd-details-title">
2884 <span class="normal">
2885 public
2886
2887
2888
2889
2890 Point
2891 </span>
2892 <span class="sympad">getDisplaySizeDp</span>
2893 <span class="normal">()</span>
2894 </h4>
2895 <div class="api-level">
2896 <div></div>
2897
2898
2899
2900 </div>
2901 <div class="jd-details-descr">
2902
2903
2904
2905
2906 <div class="jd-tagdata jd-tagdescr"><p>Returns the display size in dp (device-independent pixel)
2907
2908 The returned display size is adjusted per screen rotation. Also this will return the actual
2909 size of the screen, rather than adjusted per system decorations (like status bar).</p></div>
2910 <div class="jd-tagdata">
2911 <h5 class="jd-tagtitle">Returns</h5>
2912 <ul class="nolist"><li>a Point containing the display size in dp
2913</li></ul>
2914 </div>
2915
2916 </div>
2917</div>
2918
2919
2920<A NAME="getDisplayWidth()"></A>
2921
2922<div class="jd-details api apilevel-">
2923 <h4 class="jd-details-title">
2924 <span class="normal">
2925 public
2926
2927
2928
2929
2930 int
2931 </span>
2932 <span class="sympad">getDisplayWidth</span>
2933 <span class="normal">()</span>
2934 </h4>
2935 <div class="api-level">
2936 <div></div>
2937
2938
2939
2940 </div>
2941 <div class="jd-details-descr">
2942
2943
2944
2945
2946 <div class="jd-tagdata jd-tagdescr"><p>Gets the width of the display, in pixels. The width and height details
2947 are reported based on the current orientation of the display.</p></div>
2948 <div class="jd-tagdata">
2949 <h5 class="jd-tagtitle">Returns</h5>
2950 <ul class="nolist"><li>width in pixels or zero on failure</li></ul>
2951 </div>
2952
2953 </div>
2954</div>
2955
2956
2957<A NAME="getInstance(android.app.Instrumentation)"></A>
2958
2959<div class="jd-details api apilevel-">
2960 <h4 class="jd-details-title">
2961 <span class="normal">
2962 public
2963 static
2964
2965
2966
2967 <a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a>
2968 </span>
2969 <span class="sympad">getInstance</span>
2970 <span class="normal">(Instrumentation instrumentation)</span>
2971 </h4>
2972 <div class="api-level">
2973 <div></div>
2974
2975
2976
2977 </div>
2978 <div class="jd-details-descr">
2979
2980
2981
2982
2983 <div class="jd-tagdata jd-tagdescr"><p>Retrieves a singleton instance of UiDevice</p></div>
2984 <div class="jd-tagdata">
2985 <h5 class="jd-tagtitle">Returns</h5>
2986 <ul class="nolist"><li>UiDevice instance
2987</li></ul>
2988 </div>
2989
2990 </div>
2991</div>
2992
2993
2994<A NAME="getInstance()"></A>
2995
2996<div class="jd-details api apilevel-">
2997 <h4 class="jd-details-title">
2998 <span class="normal">
2999 public
3000 static
3001
3002
3003
3004 <a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a>
3005 </span>
3006 <span class="sympad">getInstance</span>
3007 <span class="normal">()</span>
3008 </h4>
3009 <div class="api-level">
3010 <div></div>
3011
3012
3013
3014 </div>
3015 <div class="jd-details-descr">
3016
3017
3018
3019 <p>
3020 <p class="caution"><strong>
3021 This method is deprecated.</strong><br/>
3022 Should use <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#getInstance(android.app.Instrumentation)">getInstance(Instrumentation)</a></code> instead. This version hides
3023 UiDevice's dependency on having an Instrumentation reference and is prone to misuse.
3024 </p>
3025 <div class="jd-tagdata jd-tagdescr"><p>Retrieves a singleton instance of UiDevice</p></div>
3026 <div class="jd-tagdata">
3027 <h5 class="jd-tagtitle">Returns</h5>
3028 <ul class="nolist"><li>UiDevice instance</li></ul>
3029 </div>
3030
3031 </div>
3032</div>
3033
3034
3035<A NAME="getLastTraversedText()"></A>
3036
3037<div class="jd-details api apilevel-">
3038 <h4 class="jd-details-title">
3039 <span class="normal">
3040 public
3041
3042
3043
3044
3045 String
3046 </span>
3047 <span class="sympad">getLastTraversedText</span>
3048 <span class="normal">()</span>
3049 </h4>
3050 <div class="api-level">
3051 <div></div>
3052
3053
3054
3055 </div>
3056 <div class="jd-details-descr">
3057
3058
3059
3060
3061 <div class="jd-tagdata jd-tagdescr"><p>Retrieves the text from the last UI traversal event received.
3062
3063 You can use this method to read the contents in a WebView container
3064 because the accessibility framework fires events
3065 as each text is highlighted. You can write a test to perform
3066 directional arrow presses to focus on different elements inside a WebView,
3067 and call this method to get the text from each traversed element.
3068 If you are testing a view container that can return a reference to a
3069 Document Object Model (DOM) object, your test should use the view's
3070 DOM instead.</p></div>
3071 <div class="jd-tagdata">
3072 <h5 class="jd-tagtitle">Returns</h5>
3073 <ul class="nolist"><li>text of the last traversal event, else return an empty string</li></ul>
3074 </div>
3075
3076 </div>
3077</div>
3078
3079
3080<A NAME="getProductName()"></A>
3081
3082<div class="jd-details api apilevel-">
3083 <h4 class="jd-details-title">
3084 <span class="normal">
3085 public
3086
3087
3088
3089
3090 String
3091 </span>
3092 <span class="sympad">getProductName</span>
3093 <span class="normal">()</span>
3094 </h4>
3095 <div class="api-level">
3096 <div></div>
3097
3098
3099
3100 </div>
3101 <div class="jd-details-descr">
3102
3103
3104
3105
3106 <div class="jd-tagdata jd-tagdescr"><p>Retrieves the product name of the device.
3107
3108 This method provides information on what type of device the test is running on. This value is
3109 the same as returned by invoking #adb shell getprop ro.product.name.</p></div>
3110 <div class="jd-tagdata">
3111 <h5 class="jd-tagtitle">Returns</h5>
3112 <ul class="nolist"><li>product name of the device</li></ul>
3113 </div>
3114
3115 </div>
3116</div>
3117
3118
3119<A NAME="hasAnyWatcherTriggered()"></A>
3120
3121<div class="jd-details api apilevel-">
3122 <h4 class="jd-details-title">
3123 <span class="normal">
3124 public
3125
3126
3127
3128
3129 boolean
3130 </span>
3131 <span class="sympad">hasAnyWatcherTriggered</span>
3132 <span class="normal">()</span>
3133 </h4>
3134 <div class="api-level">
3135 <div></div>
3136
3137
3138
3139 </div>
3140 <div class="jd-details-descr">
3141
3142
3143
3144
3145 <div class="jd-tagdata jd-tagdescr"><p>Checks if any registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> have triggered.
3146
3147 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher(String, UiWatcher)</a></code>
3148 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered(String)</a></code></p></div>
3149
3150 </div>
3151</div>
3152
3153
3154<A NAME="hasObject(android.support.test.uiautomator.BySelector)"></A>
3155
3156<div class="jd-details api apilevel-">
3157 <h4 class="jd-details-title">
3158 <span class="normal">
3159 public
3160
3161
3162
3163
3164 boolean
3165 </span>
3166 <span class="sympad">hasObject</span>
3167 <span class="normal">(<a href="../../../../../reference/android/support/test/uiautomator/BySelector.html">BySelector</a> selector)</span>
3168 </h4>
3169 <div class="api-level">
3170 <div></div>
3171
3172
3173
3174 </div>
3175 <div class="jd-details-descr">
3176
3177
3178
3179
3180 <div class="jd-tagdata jd-tagdescr"><p>Returns whether there is a match for the given <code>selector</code> criteria. </p></div>
3181
3182 </div>
3183</div>
3184
3185
3186<A NAME="hasWatcherTriggered(java.lang.String)"></A>
3187
3188<div class="jd-details api apilevel-">
3189 <h4 class="jd-details-title">
3190 <span class="normal">
3191 public
3192
3193
3194
3195
3196 boolean
3197 </span>
3198 <span class="sympad">hasWatcherTriggered</span>
3199 <span class="normal">(String watcherName)</span>
3200 </h4>
3201 <div class="api-level">
3202 <div></div>
3203
3204
3205
3206 </div>
3207 <div class="jd-details-descr">
3208
3209
3210
3211
3212 <div class="jd-tagdata jd-tagdescr"><p>Checks if a specific registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> has triggered.
3213 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher(String, UiWatcher)</a></code>. If a UiWatcher runs and its
3214 <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call returned <code>true</code>, then
3215 the UiWatcher is considered triggered. This is helpful if a watcher is detecting errors
3216 from ANR or crash dialogs and the test needs to know if a UiWatcher has been triggered.</p></div>
3217 <div class="jd-tagdata">
3218 <h5 class="jd-tagtitle">Returns</h5>
3219 <ul class="nolist"><li>true if triggered else false</li></ul>
3220 </div>
3221
3222 </div>
3223</div>
3224
3225
3226<A NAME="isNaturalOrientation()"></A>
3227
3228<div class="jd-details api apilevel-">
3229 <h4 class="jd-details-title">
3230 <span class="normal">
3231 public
3232
3233
3234
3235
3236 boolean
3237 </span>
3238 <span class="sympad">isNaturalOrientation</span>
3239 <span class="normal">()</span>
3240 </h4>
3241 <div class="api-level">
3242 <div></div>
3243
3244
3245
3246 </div>
3247 <div class="jd-details-descr">
3248
3249
3250
3251
3252 <div class="jd-tagdata jd-tagdescr"><p>Check if the device is in its natural orientation. This is determined by checking if the
3253 orientation is at 0 or 180 degrees.</p></div>
3254 <div class="jd-tagdata">
3255 <h5 class="jd-tagtitle">Returns</h5>
3256 <ul class="nolist"><li>true if it is in natural orientation</li></ul>
3257 </div>
3258
3259 </div>
3260</div>
3261
3262
3263<A NAME="isScreenOn()"></A>
3264
3265<div class="jd-details api apilevel-">
3266 <h4 class="jd-details-title">
3267 <span class="normal">
3268 public
3269
3270
3271
3272
3273 boolean
3274 </span>
3275 <span class="sympad">isScreenOn</span>
3276 <span class="normal">()</span>
3277 </h4>
3278 <div class="api-level">
3279 <div></div>
3280
3281
3282
3283 </div>
3284 <div class="jd-details-descr">
3285
3286
3287
3288
3289 <div class="jd-tagdata jd-tagdescr"><p>Checks the power manager if the screen is ON.</p></div>
3290 <div class="jd-tagdata">
3291 <h5 class="jd-tagtitle">Returns</h5>
3292 <ul class="nolist"><li>true if the screen is ON else false</li></ul>
3293 </div>
3294 <div class="jd-tagdata">
3295 <h5 class="jd-tagtitle">Throws</h5>
3296 <table class="jd-tagtable">
3297 <tr>
3298 <th></td>
3299 <td>RemoteException</td>
3300 </tr>
3301 <tr>
3302 <th>RemoteException</td>
3303 <td></td>
3304 </tr>
3305 </table>
3306 </div>
3307
3308 </div>
3309</div>
3310
3311
3312<A NAME="openNotification()"></A>
3313
3314<div class="jd-details api apilevel-">
3315 <h4 class="jd-details-title">
3316 <span class="normal">
3317 public
3318
3319
3320
3321
3322 boolean
3323 </span>
3324 <span class="sympad">openNotification</span>
3325 <span class="normal">()</span>
3326 </h4>
3327 <div class="api-level">
3328 <div></div>
3329
3330
3331
3332 </div>
3333 <div class="jd-details-descr">
3334
3335
3336
3337
3338 <div class="jd-tagdata jd-tagdescr"><p>Opens the notification shade.</p></div>
3339 <div class="jd-tagdata">
3340 <h5 class="jd-tagtitle">Returns</h5>
3341 <ul class="nolist"><li>true if successful, else return false</li></ul>
3342 </div>
3343
3344 </div>
3345</div>
3346
3347
3348<A NAME="openQuickSettings()"></A>
3349
3350<div class="jd-details api apilevel-">
3351 <h4 class="jd-details-title">
3352 <span class="normal">
3353 public
3354
3355
3356
3357
3358 boolean
3359 </span>
3360 <span class="sympad">openQuickSettings</span>
3361 <span class="normal">()</span>
3362 </h4>
3363 <div class="api-level">
3364 <div></div>
3365
3366
3367
3368 </div>
3369 <div class="jd-details-descr">
3370
3371
3372
3373
3374 <div class="jd-tagdata jd-tagdescr"><p>Opens the Quick Settings shade.</p></div>
3375 <div class="jd-tagdata">
3376 <h5 class="jd-tagtitle">Returns</h5>
3377 <ul class="nolist"><li>true if successful, else return false</li></ul>
3378 </div>
3379
3380 </div>
3381</div>
3382
3383
3384<A NAME="performActionAndWait(java.lang.Runnable, android.support.test.uiautomator.EventCondition<R>, long)"></A>
3385
3386<div class="jd-details api apilevel-">
3387 <h4 class="jd-details-title">
3388 <span class="normal">
3389 public
3390
3391
3392
3393
3394 R
3395 </span>
3396 <span class="sympad">performActionAndWait</span>
3397 <span class="normal">(Runnable action, <a href="../../../../../reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a>&lt;R&gt; condition, long timeout)</span>
3398 </h4>
3399 <div class="api-level">
3400 <div></div>
3401
3402
3403
3404 </div>
3405 <div class="jd-details-descr">
3406
3407
3408
3409
3410 <div class="jd-tagdata jd-tagdescr"><p>Performs the provided <code>action</code> and waits for the <code>condition</code> to be met.</p></div>
3411 <div class="jd-tagdata">
3412 <h5 class="jd-tagtitle">Parameters</h5>
3413 <table class="jd-tagtable">
3414 <tr>
3415 <th>action</td>
3416 <td>The <code><a href="../../../../../reference/java/lang/Runnable.html">Runnable</a></code> action to perform.</td>
3417 </tr>
3418 <tr>
3419 <th>condition</td>
3420 <td>The <code><a href="../../../../../reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a></code> to evaluate.</td>
3421 </tr>
3422 <tr>
3423 <th>timeout</td>
3424 <td>Maximum amount of time to wait in milliseconds.</td>
3425 </tr>
3426 </table>
3427 </div>
3428 <div class="jd-tagdata">
3429 <h5 class="jd-tagtitle">Returns</h5>
3430 <ul class="nolist"><li>The final result returned by the condition.
3431</li></ul>
3432 </div>
3433
3434 </div>
3435</div>
3436
3437
3438<A NAME="pressBack()"></A>
3439
3440<div class="jd-details api apilevel-">
3441 <h4 class="jd-details-title">
3442 <span class="normal">
3443 public
3444
3445
3446
3447
3448 boolean
3449 </span>
3450 <span class="sympad">pressBack</span>
3451 <span class="normal">()</span>
3452 </h4>
3453 <div class="api-level">
3454 <div></div>
3455
3456
3457
3458 </div>
3459 <div class="jd-details-descr">
3460
3461
3462
3463
3464 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the BACK button.</p></div>
3465 <div class="jd-tagdata">
3466 <h5 class="jd-tagtitle">Returns</h5>
3467 <ul class="nolist"><li>true if successful, else return false</li></ul>
3468 </div>
3469
3470 </div>
3471</div>
3472
3473
3474<A NAME="pressDPadCenter()"></A>
3475
3476<div class="jd-details api apilevel-">
3477 <h4 class="jd-details-title">
3478 <span class="normal">
3479 public
3480
3481
3482
3483
3484 boolean
3485 </span>
3486 <span class="sympad">pressDPadCenter</span>
3487 <span class="normal">()</span>
3488 </h4>
3489 <div class="api-level">
3490 <div></div>
3491
3492
3493
3494 </div>
3495 <div class="jd-details-descr">
3496
3497
3498
3499
3500 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the CENTER button.</p></div>
3501 <div class="jd-tagdata">
3502 <h5 class="jd-tagtitle">Returns</h5>
3503 <ul class="nolist"><li>true if successful, else return false</li></ul>
3504 </div>
3505
3506 </div>
3507</div>
3508
3509
3510<A NAME="pressDPadDown()"></A>
3511
3512<div class="jd-details api apilevel-">
3513 <h4 class="jd-details-title">
3514 <span class="normal">
3515 public
3516
3517
3518
3519
3520 boolean
3521 </span>
3522 <span class="sympad">pressDPadDown</span>
3523 <span class="normal">()</span>
3524 </h4>
3525 <div class="api-level">
3526 <div></div>
3527
3528
3529
3530 </div>
3531 <div class="jd-details-descr">
3532
3533
3534
3535
3536 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DOWN button.</p></div>
3537 <div class="jd-tagdata">
3538 <h5 class="jd-tagtitle">Returns</h5>
3539 <ul class="nolist"><li>true if successful, else return false</li></ul>
3540 </div>
3541
3542 </div>
3543</div>
3544
3545
3546<A NAME="pressDPadLeft()"></A>
3547
3548<div class="jd-details api apilevel-">
3549 <h4 class="jd-details-title">
3550 <span class="normal">
3551 public
3552
3553
3554
3555
3556 boolean
3557 </span>
3558 <span class="sympad">pressDPadLeft</span>
3559 <span class="normal">()</span>
3560 </h4>
3561 <div class="api-level">
3562 <div></div>
3563
3564
3565
3566 </div>
3567 <div class="jd-details-descr">
3568
3569
3570
3571
3572 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the LEFT button.</p></div>
3573 <div class="jd-tagdata">
3574 <h5 class="jd-tagtitle">Returns</h5>
3575 <ul class="nolist"><li>true if successful, else return false</li></ul>
3576 </div>
3577
3578 </div>
3579</div>
3580
3581
3582<A NAME="pressDPadRight()"></A>
3583
3584<div class="jd-details api apilevel-">
3585 <h4 class="jd-details-title">
3586 <span class="normal">
3587 public
3588
3589
3590
3591
3592 boolean
3593 </span>
3594 <span class="sympad">pressDPadRight</span>
3595 <span class="normal">()</span>
3596 </h4>
3597 <div class="api-level">
3598 <div></div>
3599
3600
3601
3602 </div>
3603 <div class="jd-details-descr">
3604
3605
3606
3607
3608 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the RIGHT button.</p></div>
3609 <div class="jd-tagdata">
3610 <h5 class="jd-tagtitle">Returns</h5>
3611 <ul class="nolist"><li>true if successful, else return false</li></ul>
3612 </div>
3613
3614 </div>
3615</div>
3616
3617
3618<A NAME="pressDPadUp()"></A>
3619
3620<div class="jd-details api apilevel-">
3621 <h4 class="jd-details-title">
3622 <span class="normal">
3623 public
3624
3625
3626
3627
3628 boolean
3629 </span>
3630 <span class="sympad">pressDPadUp</span>
3631 <span class="normal">()</span>
3632 </h4>
3633 <div class="api-level">
3634 <div></div>
3635
3636
3637
3638 </div>
3639 <div class="jd-details-descr">
3640
3641
3642
3643
3644 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the UP button.</p></div>
3645 <div class="jd-tagdata">
3646 <h5 class="jd-tagtitle">Returns</h5>
3647 <ul class="nolist"><li>true if successful, else return false</li></ul>
3648 </div>
3649
3650 </div>
3651</div>
3652
3653
3654<A NAME="pressDelete()"></A>
3655
3656<div class="jd-details api apilevel-">
3657 <h4 class="jd-details-title">
3658 <span class="normal">
3659 public
3660
3661
3662
3663
3664 boolean
3665 </span>
3666 <span class="sympad">pressDelete</span>
3667 <span class="normal">()</span>
3668 </h4>
3669 <div class="api-level">
3670 <div></div>
3671
3672
3673
3674 </div>
3675 <div class="jd-details-descr">
3676
3677
3678
3679
3680 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DELETE key.</p></div>
3681 <div class="jd-tagdata">
3682 <h5 class="jd-tagtitle">Returns</h5>
3683 <ul class="nolist"><li>true if successful, else return false</li></ul>
3684 </div>
3685
3686 </div>
3687</div>
3688
3689
3690<A NAME="pressEnter()"></A>
3691
3692<div class="jd-details api apilevel-">
3693 <h4 class="jd-details-title">
3694 <span class="normal">
3695 public
3696
3697
3698
3699
3700 boolean
3701 </span>
3702 <span class="sympad">pressEnter</span>
3703 <span class="normal">()</span>
3704 </h4>
3705 <div class="api-level">
3706 <div></div>
3707
3708
3709
3710 </div>
3711 <div class="jd-details-descr">
3712
3713
3714
3715
3716 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the ENTER key.</p></div>
3717 <div class="jd-tagdata">
3718 <h5 class="jd-tagtitle">Returns</h5>
3719 <ul class="nolist"><li>true if successful, else return false</li></ul>
3720 </div>
3721
3722 </div>
3723</div>
3724
3725
3726<A NAME="pressHome()"></A>
3727
3728<div class="jd-details api apilevel-">
3729 <h4 class="jd-details-title">
3730 <span class="normal">
3731 public
3732
3733
3734
3735
3736 boolean
3737 </span>
3738 <span class="sympad">pressHome</span>
3739 <span class="normal">()</span>
3740 </h4>
3741 <div class="api-level">
3742 <div></div>
3743
3744
3745
3746 </div>
3747 <div class="jd-details-descr">
3748
3749
3750
3751
3752 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the HOME button.</p></div>
3753 <div class="jd-tagdata">
3754 <h5 class="jd-tagtitle">Returns</h5>
3755 <ul class="nolist"><li>true if successful, else return false</li></ul>
3756 </div>
3757
3758 </div>
3759</div>
3760
3761
3762<A NAME="pressKeyCode(int, int)"></A>
3763
3764<div class="jd-details api apilevel-">
3765 <h4 class="jd-details-title">
3766 <span class="normal">
3767 public
3768
3769
3770
3771
3772 boolean
3773 </span>
3774 <span class="sympad">pressKeyCode</span>
3775 <span class="normal">(int keyCode, int metaState)</span>
3776 </h4>
3777 <div class="api-level">
3778 <div></div>
3779
3780
3781
3782 </div>
3783 <div class="jd-details-descr">
3784
3785
3786
3787
3788 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code.
3789
3790 See <code><a href="../../../../../reference/android/view/KeyEvent.html">KeyEvent</a></code>.</p></div>
3791 <div class="jd-tagdata">
3792 <h5 class="jd-tagtitle">Parameters</h5>
3793 <table class="jd-tagtable">
3794 <tr>
3795 <th>keyCode</td>
3796 <td>the key code of the event.</td>
3797 </tr>
3798 <tr>
3799 <th>metaState</td>
3800 <td>an integer in which each bit set to 1 represents a pressed meta key</td>
3801 </tr>
3802 </table>
3803 </div>
3804 <div class="jd-tagdata">
3805 <h5 class="jd-tagtitle">Returns</h5>
3806 <ul class="nolist"><li>true if successful, else return false</li></ul>
3807 </div>
3808
3809 </div>
3810</div>
3811
3812
3813<A NAME="pressKeyCode(int)"></A>
3814
3815<div class="jd-details api apilevel-">
3816 <h4 class="jd-details-title">
3817 <span class="normal">
3818 public
3819
3820
3821
3822
3823 boolean
3824 </span>
3825 <span class="sympad">pressKeyCode</span>
3826 <span class="normal">(int keyCode)</span>
3827 </h4>
3828 <div class="api-level">
3829 <div></div>
3830
3831
3832
3833 </div>
3834 <div class="jd-details-descr">
3835
3836
3837
3838
3839 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code.
3840
3841 See <code><a href="../../../../../reference/android/view/KeyEvent.html">KeyEvent</a></code></p></div>
3842 <div class="jd-tagdata">
3843 <h5 class="jd-tagtitle">Returns</h5>
3844 <ul class="nolist"><li>true if successful, else return false</li></ul>
3845 </div>
3846
3847 </div>
3848</div>
3849
3850
3851<A NAME="pressMenu()"></A>
3852
3853<div class="jd-details api apilevel-">
3854 <h4 class="jd-details-title">
3855 <span class="normal">
3856 public
3857
3858
3859
3860
3861 boolean
3862 </span>
3863 <span class="sympad">pressMenu</span>
3864 <span class="normal">()</span>
3865 </h4>
3866 <div class="api-level">
3867 <div></div>
3868
3869
3870
3871 </div>
3872 <div class="jd-details-descr">
3873
3874
3875
3876
3877 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the MENU button.</p></div>
3878 <div class="jd-tagdata">
3879 <h5 class="jd-tagtitle">Returns</h5>
3880 <ul class="nolist"><li>true if successful, else return false</li></ul>
3881 </div>
3882
3883 </div>
3884</div>
3885
3886
3887<A NAME="pressRecentApps()"></A>
3888
3889<div class="jd-details api apilevel-">
3890 <h4 class="jd-details-title">
3891 <span class="normal">
3892 public
3893
3894
3895
3896
3897 boolean
3898 </span>
3899 <span class="sympad">pressRecentApps</span>
3900 <span class="normal">()</span>
3901 </h4>
3902 <div class="api-level">
3903 <div></div>
3904
3905
3906
3907 </div>
3908 <div class="jd-details-descr">
3909
3910
3911
3912
3913 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the Recent Apps button.</p></div>
3914 <div class="jd-tagdata">
3915 <h5 class="jd-tagtitle">Returns</h5>
3916 <ul class="nolist"><li>true if successful, else return false</li></ul>
3917 </div>
3918 <div class="jd-tagdata">
3919 <h5 class="jd-tagtitle">Throws</h5>
3920 <table class="jd-tagtable">
3921 <tr>
3922 <th></td>
3923 <td>RemoteException</td>
3924 </tr>
3925 <tr>
3926 <th>RemoteException</td>
3927 <td></td>
3928 </tr>
3929 </table>
3930 </div>
3931
3932 </div>
3933</div>
3934
3935
3936<A NAME="pressSearch()"></A>
3937
3938<div class="jd-details api apilevel-">
3939 <h4 class="jd-details-title">
3940 <span class="normal">
3941 public
3942
3943
3944
3945
3946 boolean
3947 </span>
3948 <span class="sympad">pressSearch</span>
3949 <span class="normal">()</span>
3950 </h4>
3951 <div class="api-level">
3952 <div></div>
3953
3954
3955
3956 </div>
3957 <div class="jd-details-descr">
3958
3959
3960
3961
3962 <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the SEARCH button.</p></div>
3963 <div class="jd-tagdata">
3964 <h5 class="jd-tagtitle">Returns</h5>
3965 <ul class="nolist"><li>true if successful, else return false</li></ul>
3966 </div>
3967
3968 </div>
3969</div>
3970
3971
3972<A NAME="registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)"></A>
3973
3974<div class="jd-details api apilevel-">
3975 <h4 class="jd-details-title">
3976 <span class="normal">
3977 public
3978
3979
3980
3981
3982 void
3983 </span>
3984 <span class="sympad">registerWatcher</span>
3985 <span class="normal">(String name, <a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a> watcher)</span>
3986 </h4>
3987 <div class="api-level">
3988 <div></div>
3989
3990
3991
3992 </div>
3993 <div class="jd-details-descr">
3994
3995
3996
3997
3998 <div class="jd-tagdata jd-tagdescr"><p>Registers a <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to
3999 find a match using a <code><a href="../../../../../reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code>. See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#runWatchers()">runWatchers()</a></code></p></div>
4000 <div class="jd-tagdata">
4001 <h5 class="jd-tagtitle">Parameters</h5>
4002 <table class="jd-tagtable">
4003 <tr>
4004 <th>name</td>
4005 <td>to register the UiWatcher</td>
4006 </tr>
4007 <tr>
4008 <th>watcher</td>
4009 <td><code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code></td>
4010 </tr>
4011 </table>
4012 </div>
4013
4014 </div>
4015</div>
4016
4017
4018<A NAME="removeWatcher(java.lang.String)"></A>
4019
4020<div class="jd-details api apilevel-">
4021 <h4 class="jd-details-title">
4022 <span class="normal">
4023 public
4024
4025
4026
4027
4028 void
4029 </span>
4030 <span class="sympad">removeWatcher</span>
4031 <span class="normal">(String name)</span>
4032 </h4>
4033 <div class="api-level">
4034 <div></div>
4035
4036
4037
4038 </div>
4039 <div class="jd-details-descr">
4040
4041
4042
4043
4044 <div class="jd-tagdata jd-tagdescr"><p>Removes a previously registered <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code>.
4045
4046 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div>
4047 <div class="jd-tagdata">
4048 <h5 class="jd-tagtitle">Parameters</h5>
4049 <table class="jd-tagtable">
4050 <tr>
4051 <th>name</td>
4052 <td>used to register the UiWatcher</td>
4053 </tr>
4054 </table>
4055 </div>
4056
4057 </div>
4058</div>
4059
4060
4061<A NAME="resetWatcherTriggers()"></A>
4062
4063<div class="jd-details api apilevel-">
4064 <h4 class="jd-details-title">
4065 <span class="normal">
4066 public
4067
4068
4069
4070
4071 void
4072 </span>
4073 <span class="sympad">resetWatcherTriggers</span>
4074 <span class="normal">()</span>
4075 </h4>
4076 <div class="api-level">
4077 <div></div>
4078
4079
4080
4081 </div>
4082 <div class="jd-details-descr">
4083
4084
4085
4086
4087 <div class="jd-tagdata jd-tagdescr"><p>Resets a <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></code> that has been triggered.
4088 If a UiWatcher runs and its <code><a href="../../../../../reference/android/support/test/uiautomator/UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call
4089 returned <code>true</code>, then the UiWatcher is considered triggered.
4090 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div>
4091
4092 </div>
4093</div>
4094
4095
4096<A NAME="runWatchers()"></A>
4097
4098<div class="jd-details api apilevel-">
4099 <h4 class="jd-details-title">
4100 <span class="normal">
4101 public
4102
4103
4104
4105
4106 void
4107 </span>
4108 <span class="sympad">runWatchers</span>
4109 <span class="normal">()</span>
4110 </h4>
4111 <div class="api-level">
4112 <div></div>
4113
4114
4115
4116 </div>
4117 <div class="jd-details-descr">
4118
4119
4120
4121
4122 <div class="jd-tagdata jd-tagdescr"><p>This method forces all registered watchers to run.
4123 See <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div>
4124
4125 </div>
4126</div>
4127
4128
4129<A NAME="setCompressedLayoutHeirarchy(boolean)"></A>
4130
4131<div class="jd-details api apilevel-">
4132 <h4 class="jd-details-title">
4133 <span class="normal">
4134 public
4135
4136
4137
4138
4139 void
4140 </span>
4141 <span class="sympad">setCompressedLayoutHeirarchy</span>
4142 <span class="normal">(boolean compressed)</span>
4143 </h4>
4144 <div class="api-level">
4145 <div></div>
4146
4147
4148
4149 </div>
4150 <div class="jd-details-descr">
4151
4152
4153
4154
4155 <div class="jd-tagdata jd-tagdescr"><p>Enables or disables layout hierarchy compression.
4156
4157 If compression is enabled, the layout hierarchy derived from the Acessibility
4158 framework will only contain nodes that are important for uiautomator
4159 testing. Any unnecessary surrounding layout nodes that make viewing
4160 and searching the hierarchy inefficient are removed.</p></div>
4161 <div class="jd-tagdata">
4162 <h5 class="jd-tagtitle">Parameters</h5>
4163 <table class="jd-tagtable">
4164 <tr>
4165 <th>compressed</td>
4166 <td>true to enable compression; else, false to disable</td>
4167 </tr>
4168 </table>
4169 </div>
4170
4171 </div>
4172</div>
4173
4174
4175<A NAME="setOrientationLeft()"></A>
4176
4177<div class="jd-details api apilevel-">
4178 <h4 class="jd-details-title">
4179 <span class="normal">
4180 public
4181
4182
4183
4184
4185 void
4186 </span>
4187 <span class="sympad">setOrientationLeft</span>
4188 <span class="normal">()</span>
4189 </h4>
4190 <div class="api-level">
4191 <div></div>
4192
4193
4194
4195 </div>
4196 <div class="jd-details-descr">
4197
4198
4199
4200
4201 <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the left and also freezes rotation
4202 by disabling the sensors.
4203
4204 If you want to un-freeze the rotation and re-enable the sensors
4205 see <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div>
4206 <div class="jd-tagdata">
4207 <h5 class="jd-tagtitle">Throws</h5>
4208 <table class="jd-tagtable">
4209 <tr>
4210 <th></td>
4211 <td>RemoteException</td>
4212 </tr>
4213 <tr>
4214 <th>RemoteException</td>
4215 <td></td>
4216 </tr>
4217 </table>
4218 </div>
4219
4220 </div>
4221</div>
4222
4223
4224<A NAME="setOrientationNatural()"></A>
4225
4226<div class="jd-details api apilevel-">
4227 <h4 class="jd-details-title">
4228 <span class="normal">
4229 public
4230
4231
4232
4233
4234 void
4235 </span>
4236 <span class="sympad">setOrientationNatural</span>
4237 <span class="normal">()</span>
4238 </h4>
4239 <div class="api-level">
4240 <div></div>
4241
4242
4243
4244 </div>
4245 <div class="jd-details-descr">
4246
4247
4248
4249
4250 <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device into its natural orientation and also freezes rotation
4251 by disabling the sensors.
4252
4253 If you want to un-freeze the rotation and re-enable the sensors
4254 see <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div>
4255 <div class="jd-tagdata">
4256 <h5 class="jd-tagtitle">Throws</h5>
4257 <table class="jd-tagtable">
4258 <tr>
4259 <th></td>
4260 <td>RemoteException</td>
4261 </tr>
4262 <tr>
4263 <th>RemoteException</td>
4264 <td></td>
4265 </tr>
4266 </table>
4267 </div>
4268
4269 </div>
4270</div>
4271
4272
4273<A NAME="setOrientationRight()"></A>
4274
4275<div class="jd-details api apilevel-">
4276 <h4 class="jd-details-title">
4277 <span class="normal">
4278 public
4279
4280
4281
4282
4283 void
4284 </span>
4285 <span class="sympad">setOrientationRight</span>
4286 <span class="normal">()</span>
4287 </h4>
4288 <div class="api-level">
4289 <div></div>
4290
4291
4292
4293 </div>
4294 <div class="jd-details-descr">
4295
4296
4297
4298
4299 <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the right and also freezes rotation
4300 by disabling the sensors.
4301
4302 If you want to un-freeze the rotation and re-enable the sensors
4303 see <code><a href="../../../../../reference/android/support/test/uiautomator/UiDevice.html#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div>
4304 <div class="jd-tagdata">
4305 <h5 class="jd-tagtitle">Throws</h5>
4306 <table class="jd-tagtable">
4307 <tr>
4308 <th></td>
4309 <td>RemoteException</td>
4310 </tr>
4311 <tr>
4312 <th>RemoteException</td>
4313 <td></td>
4314 </tr>
4315 </table>
4316 </div>
4317
4318 </div>
4319</div>
4320
4321
4322<A NAME="sleep()"></A>
4323
4324<div class="jd-details api apilevel-">
4325 <h4 class="jd-details-title">
4326 <span class="normal">
4327 public
4328
4329
4330
4331
4332 void
4333 </span>
4334 <span class="sympad">sleep</span>
4335 <span class="normal">()</span>
4336 </h4>
4337 <div class="api-level">
4338 <div></div>
4339
4340
4341
4342 </div>
4343 <div class="jd-details-descr">
4344
4345
4346
4347
4348 <div class="jd-tagdata jd-tagdescr"><p>This method simply presses the power button if the screen is ON else
4349 it does nothing if the screen is already OFF.</p></div>
4350 <div class="jd-tagdata">
4351 <h5 class="jd-tagtitle">Throws</h5>
4352 <table class="jd-tagtable">
4353 <tr>
4354 <th></td>
4355 <td>RemoteException</td>
4356 </tr>
4357 <tr>
4358 <th>RemoteException</td>
4359 <td></td>
4360 </tr>
4361 </table>
4362 </div>
4363
4364 </div>
4365</div>
4366
4367
4368<A NAME="swipe(android.graphics.Point[], int)"></A>
4369
4370<div class="jd-details api apilevel-">
4371 <h4 class="jd-details-title">
4372 <span class="normal">
4373 public
4374
4375
4376
4377
4378 boolean
4379 </span>
4380 <span class="sympad">swipe</span>
4381 <span class="normal">(Point[] segments, int segmentSteps)</span>
4382 </h4>
4383 <div class="api-level">
4384 <div></div>
4385
4386
4387
4388 </div>
4389 <div class="jd-details-descr">
4390
4391
4392
4393
4394 <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe between points in the Point array. Each step execution is throttled
4395 to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete</p></div>
4396 <div class="jd-tagdata">
4397 <h5 class="jd-tagtitle">Parameters</h5>
4398 <table class="jd-tagtable">
4399 <tr>
4400 <th>segments</td>
4401 <td>is Point array containing at least one Point object</td>
4402 </tr>
4403 <tr>
4404 <th>segmentSteps</td>
4405 <td>steps to inject between two Points</td>
4406 </tr>
4407 </table>
4408 </div>
4409 <div class="jd-tagdata">
4410 <h5 class="jd-tagtitle">Returns</h5>
4411 <ul class="nolist"><li>true on success</li></ul>
4412 </div>
4413
4414 </div>
4415</div>
4416
4417
4418<A NAME="swipe(int, int, int, int, int)"></A>
4419
4420<div class="jd-details api apilevel-">
4421 <h4 class="jd-details-title">
4422 <span class="normal">
4423 public
4424
4425
4426
4427
4428 boolean
4429 </span>
4430 <span class="sympad">swipe</span>
4431 <span class="normal">(int startX, int startY, int endX, int endY, int steps)</span>
4432 </h4>
4433 <div class="api-level">
4434 <div></div>
4435
4436
4437
4438 </div>
4439 <div class="jd-details-descr">
4440
4441
4442
4443
4444 <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe from one coordinate to another using the number of steps
4445 to determine smoothness and speed. Each step execution is throttled to 5ms
4446 per step. So for a 100 steps, the swipe will take about 1/2 second to complete.</p></div>
4447 <div class="jd-tagdata">
4448 <h5 class="jd-tagtitle">Parameters</h5>
4449 <table class="jd-tagtable">
4450 <tr>
4451 <th>steps</td>
4452 <td>is the number of move steps sent to the system</td>
4453 </tr>
4454 </table>
4455 </div>
4456 <div class="jd-tagdata">
4457 <h5 class="jd-tagtitle">Returns</h5>
4458 <ul class="nolist"><li>false if the operation fails or the coordinates are invalid</li></ul>
4459 </div>
4460
4461 </div>
4462</div>
4463
4464
4465<A NAME="takeScreenshot(java.io.File)"></A>
4466
4467<div class="jd-details api apilevel-">
4468 <h4 class="jd-details-title">
4469 <span class="normal">
4470 public
4471
4472
4473
4474
4475 boolean
4476 </span>
4477 <span class="sympad">takeScreenshot</span>
4478 <span class="normal">(File storePath)</span>
4479 </h4>
4480 <div class="api-level">
4481 <div></div>
4482
4483
4484
4485 </div>
4486 <div class="jd-details-descr">
4487
4488
4489
4490
4491 <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG
4492
4493 Default scale of 1.0f (original size) and 90% quality is used
4494 The screenshot is adjusted per screen rotation</p></div>
4495 <div class="jd-tagdata">
4496 <h5 class="jd-tagtitle">Parameters</h5>
4497 <table class="jd-tagtable">
4498 <tr>
4499 <th>storePath</td>
4500 <td>where the PNG should be written to</td>
4501 </tr>
4502 </table>
4503 </div>
4504 <div class="jd-tagdata">
4505 <h5 class="jd-tagtitle">Returns</h5>
4506 <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul>
4507 </div>
4508
4509 </div>
4510</div>
4511
4512
4513<A NAME="takeScreenshot(java.io.File, float, int)"></A>
4514
4515<div class="jd-details api apilevel-">
4516 <h4 class="jd-details-title">
4517 <span class="normal">
4518 public
4519
4520
4521
4522
4523 boolean
4524 </span>
4525 <span class="sympad">takeScreenshot</span>
4526 <span class="normal">(File storePath, float scale, int quality)</span>
4527 </h4>
4528 <div class="api-level">
4529 <div></div>
4530
4531
4532
4533 </div>
4534 <div class="jd-details-descr">
4535
4536
4537
4538
4539 <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG
4540
4541 The screenshot is adjusted per screen rotation</p></div>
4542 <div class="jd-tagdata">
4543 <h5 class="jd-tagtitle">Parameters</h5>
4544 <table class="jd-tagtable">
4545 <tr>
4546 <th>storePath</td>
4547 <td>where the PNG should be written to</td>
4548 </tr>
4549 <tr>
4550 <th>scale</td>
4551 <td>scale the screenshot down if needed; 1.0f for original size</td>
4552 </tr>
4553 <tr>
4554 <th>quality</td>
4555 <td>quality of the PNG compression; range: 0-100</td>
4556 </tr>
4557 </table>
4558 </div>
4559 <div class="jd-tagdata">
4560 <h5 class="jd-tagtitle">Returns</h5>
4561 <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul>
4562 </div>
4563
4564 </div>
4565</div>
4566
4567
4568<A NAME="unfreezeRotation()"></A>
4569
4570<div class="jd-details api apilevel-">
4571 <h4 class="jd-details-title">
4572 <span class="normal">
4573 public
4574
4575
4576
4577
4578 void
4579 </span>
4580 <span class="sympad">unfreezeRotation</span>
4581 <span class="normal">()</span>
4582 </h4>
4583 <div class="api-level">
4584 <div></div>
4585
4586
4587
4588 </div>
4589 <div class="jd-details-descr">
4590
4591
4592
4593
4594 <div class="jd-tagdata jd-tagdescr"><p>Re-enables the sensors and un-freezes the device rotation allowing its contents
4595 to rotate with the device physical rotation. During a test execution, it is best to
4596 keep the device frozen in a specific orientation until the test case execution has completed.</p></div>
4597 <div class="jd-tagdata">
4598 <h5 class="jd-tagtitle">Throws</h5>
4599 <table class="jd-tagtable">
4600 <tr>
4601 <th>RemoteException</td>
4602 <td></td>
4603 </tr>
4604 </table>
4605 </div>
4606
4607 </div>
4608</div>
4609
4610
4611<A NAME="wait(android.support.test.uiautomator.SearchCondition<R>, long)"></A>
4612
4613<div class="jd-details api apilevel-">
4614 <h4 class="jd-details-title">
4615 <span class="normal">
4616 public
4617
4618
4619
4620
4621 R
4622 </span>
4623 <span class="sympad">wait</span>
4624 <span class="normal">(<a href="../../../../../reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a>&lt;R&gt; condition, long timeout)</span>
4625 </h4>
4626 <div class="api-level">
4627 <div></div>
4628
4629
4630
4631 </div>
4632 <div class="jd-details-descr">
4633
4634
4635
4636
4637 <div class="jd-tagdata jd-tagdescr"><p>Waits for given the <code>condition</code> to be met.</p></div>
4638 <div class="jd-tagdata">
4639 <h5 class="jd-tagtitle">Parameters</h5>
4640 <table class="jd-tagtable">
4641 <tr>
4642 <th>condition</td>
4643 <td>The <code><a href="../../../../../reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a></code> to evaluate.</td>
4644 </tr>
4645 <tr>
4646 <th>timeout</td>
4647 <td>Maximum amount of time to wait in milliseconds.</td>
4648 </tr>
4649 </table>
4650 </div>
4651 <div class="jd-tagdata">
4652 <h5 class="jd-tagtitle">Returns</h5>
4653 <ul class="nolist"><li>The final result returned by the condition.
4654</li></ul>
4655 </div>
4656
4657 </div>
4658</div>
4659
4660
4661<A NAME="waitForIdle(long)"></A>
4662
4663<div class="jd-details api apilevel-">
4664 <h4 class="jd-details-title">
4665 <span class="normal">
4666 public
4667
4668
4669
4670
4671 void
4672 </span>
4673 <span class="sympad">waitForIdle</span>
4674 <span class="normal">(long timeout)</span>
4675 </h4>
4676 <div class="api-level">
4677 <div></div>
4678
4679
4680
4681 </div>
4682 <div class="jd-details-descr">
4683
4684
4685
4686
4687 <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle.</p></div>
4688 <div class="jd-tagdata">
4689 <h5 class="jd-tagtitle">Parameters</h5>
4690 <table class="jd-tagtable">
4691 <tr>
4692 <th>timeout</td>
4693 <td>in milliseconds</td>
4694 </tr>
4695 </table>
4696 </div>
4697
4698 </div>
4699</div>
4700
4701
4702<A NAME="waitForIdle()"></A>
4703
4704<div class="jd-details api apilevel-">
4705 <h4 class="jd-details-title">
4706 <span class="normal">
4707 public
4708
4709
4710
4711
4712 void
4713 </span>
4714 <span class="sympad">waitForIdle</span>
4715 <span class="normal">()</span>
4716 </h4>
4717 <div class="api-level">
4718 <div></div>
4719
4720
4721
4722 </div>
4723 <div class="jd-details-descr">
4724
4725
4726
4727
4728 <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle.
4729 Default wait timeout is 10 seconds</p></div>
4730
4731 </div>
4732</div>
4733
4734
4735<A NAME="waitForWindowUpdate(java.lang.String, long)"></A>
4736
4737<div class="jd-details api apilevel-">
4738 <h4 class="jd-details-title">
4739 <span class="normal">
4740 public
4741
4742
4743
4744
4745 boolean
4746 </span>
4747 <span class="sympad">waitForWindowUpdate</span>
4748 <span class="normal">(String packageName, long timeout)</span>
4749 </h4>
4750 <div class="api-level">
4751 <div></div>
4752
4753
4754
4755 </div>
4756 <div class="jd-details-descr">
4757
4758
4759
4760
4761 <div class="jd-tagdata jd-tagdescr"><p>Waits for a window content update event to occur.
4762
4763 If a package name for the window is specified, but the current window
4764 does not have the same package name, the function returns immediately.</p></div>
4765 <div class="jd-tagdata">
4766 <h5 class="jd-tagtitle">Parameters</h5>
4767 <table class="jd-tagtable">
4768 <tr>
4769 <th>packageName</td>
4770 <td>the specified window package name (can be <code>null</code>).
4771 If <code>null</code>, a window update from any front-end window will end the wait</td>
4772 </tr>
4773 <tr>
4774 <th>timeout</td>
4775 <td>the timeout for the wait</td>
4776 </tr>
4777 </table>
4778 </div>
4779 <div class="jd-tagdata">
4780 <h5 class="jd-tagtitle">Returns</h5>
4781 <ul class="nolist"><li>true if a window update occurred, false if timeout has elapsed or if the current
4782 window does not have the specified package name</li></ul>
4783 </div>
4784
4785 </div>
4786</div>
4787
4788
4789<A NAME="wakeUp()"></A>
4790
4791<div class="jd-details api apilevel-">
4792 <h4 class="jd-details-title">
4793 <span class="normal">
4794 public
4795
4796
4797
4798
4799 void
4800 </span>
4801 <span class="sympad">wakeUp</span>
4802 <span class="normal">()</span>
4803 </h4>
4804 <div class="api-level">
4805 <div></div>
4806
4807
4808
4809 </div>
4810 <div class="jd-details-descr">
4811
4812
4813
4814
4815 <div class="jd-tagdata jd-tagdescr"><p>This method simulates pressing the power button if the screen is OFF else
4816 it does nothing if the screen is already ON.
4817
4818 If the screen was OFF and it just got turned ON, this method will insert a 500ms delay
4819 to allow the device time to wake up and accept input.</p></div>
4820 <div class="jd-tagdata">
4821 <h5 class="jd-tagtitle">Throws</h5>
4822 <table class="jd-tagtable">
4823 <tr>
4824 <th></td>
4825 <td>RemoteException</td>
4826 </tr>
4827 <tr>
4828 <th>RemoteException</td>
4829 <td></td>
4830 </tr>
4831 </table>
4832 </div>
4833
4834 </div>
4835</div>
4836
4837
4838
4839
4840
4841<!-- ========= METHOD DETAIL ======== -->
4842
4843
4844
4845<!-- ========= END OF CLASS DATA ========= -->
4846<A NAME="navbar_top"></A>
4847
4848<div id="footer" class="wrap" >
4849
4850
4851 <div id="copyright">
4852
4853 Except as noted, this content is licensed under <a
4854 href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
4855 For details and restrictions, see the <a href="../../../../../license.html">
4856 Content License</a>.
4857 </div>
4858 <div id="build_info">
4859
4860 Android &nbsp;r &mdash;
4861<script src="../../../../../timestamp.js" type="text/javascript"></script>
4862<script>document.write(BUILD_TIMESTAMP)</script>
4863
4864 </div>
4865
4866
4867 <div id="footerlinks">
4868
4869 <p>
4870 <a href="../../../../../about/index.html">About Android</a>&nbsp;&nbsp;|&nbsp;
4871 <a href="../../../../../legal.html">Legal</a>&nbsp;&nbsp;|&nbsp;
4872 <a href="../../../../../support.html">Support</a>
4873 </p>
4874 </div>
4875
4876</div> <!-- end footer -->
4877</div> <!-- jd-content -->
4878
4879</div><!-- end doc-content -->
4880
4881</div> <!-- end body-content -->
4882
4883
4884
4885
4886
4887
4888</body>
4889</html>