Quddus Chong | 489218c | 2015-02-26 16:38:46 -0800 | [diff] [blame] | 1 | <!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>CountingIdlingResource | Android Developers</title> |
| 107 | |
| 108 | <!-- STYLESHEETS --> |
| 109 | <link rel="stylesheet" |
| 110 | href="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" |
| 118 | type="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"> </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 & Retain</a></li> |
| 348 | <li><a href="../../../../../../distribute/monetize/index.html">Monetize</a></li> |
| 349 | <li><a href="../../../../../../distribute/tools/index.html">Tools & 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">CountingIdlingResource</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="selected 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="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/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html">RecyclerViewActions.PositionableRecyclerViewAction</a></li> |
| 521 | </ul> |
| 522 | </li> |
| 523 | |
| 524 | <li><h2>Classes</h2> |
| 525 | <ul> |
| 526 | <li class="selected api apilevel-"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html">CountingIdlingResource</a></li> |
| 527 | <li class="api apilevel-"><a href="../../../../../../reference/android/support/test/espresso/contrib/DrawerActions.html">DrawerActions</a></li> |
| 528 | <li class="api apilevel-"><a href="../../../../../../reference/android/support/test/espresso/contrib/DrawerMatchers.html">DrawerMatchers</a></li> |
| 529 | <li class="api apilevel-"><a href="../../../../../../reference/android/support/test/espresso/contrib/PickerActions.html">PickerActions</a></li> |
| 530 | <li class="api apilevel-"><a href="../../../../../../reference/android/support/test/espresso/contrib/RecyclerViewActions.html">RecyclerViewActions</a></li> |
| 531 | </ul> |
| 532 | </li> |
| 533 | |
| 534 | |
| 535 | |
| 536 | </ul><br/> |
| 537 | |
| 538 | |
| 539 | </div><!-- end classes --> |
| 540 | </div><!-- end nav-panels --> |
| 541 | <div id="nav-tree" style="display:none" class="scroll-pane"> |
| 542 | <div id="tree-list"></div> |
| 543 | </div><!-- end nav-tree --> |
| 544 | </div><!-- end swapper --> |
| 545 | <div id="nav-swap"> |
| 546 | <a class="fullscreen">fullscreen</a> |
| 547 | <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> |
| 548 | </div> |
| 549 | </div> <!-- end devdoc-nav --> |
| 550 | </div> <!-- end side-nav --> |
| 551 | <script type="text/javascript"> |
| 552 | // init fullscreen based on user pref |
| 553 | var fullscreen = readCookie("fullscreen"); |
| 554 | if (fullscreen != 0) { |
| 555 | if (fullscreen == "false") { |
| 556 | toggleFullscreen(false); |
| 557 | } else { |
| 558 | toggleFullscreen(true); |
| 559 | } |
| 560 | } |
| 561 | // init nav version for mobile |
| 562 | if (isMobile) { |
| 563 | swapNav(); // tree view should be used on mobile |
| 564 | $('#nav-swap').hide(); |
| 565 | } else { |
| 566 | chooseDefaultNav(); |
| 567 | if ($("#nav-tree").is(':visible')) { |
| 568 | init_default_navtree("../../../../../../"); |
| 569 | } |
| 570 | } |
| 571 | // scroll the selected page into view |
| 572 | $(document).ready(function() { |
| 573 | scrollIntoView("packages-nav"); |
| 574 | scrollIntoView("classes-nav"); |
| 575 | }); |
| 576 | </script> |
| 577 | |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | <div class="col-12" id="doc-col"> |
| 583 | |
| 584 | <div id="api-info-block"> |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | <div class="sum-details-links"> |
| 604 | |
| 605 | Summary: |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | <a href="#pubctors">Ctors</a> |
| 616 | |
| 617 | |
| 618 | |
| 619 | |
| 620 | | <a href="#pubmethods">Methods</a> |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | | <a href="#inhmethods">Inherited Methods</a> |
| 626 | |
| 627 | | <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> |
| 628 | |
| 629 | </div><!-- end sum-details-links --> |
| 630 | <div class="api-level"> |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | </div> |
| 636 | </div><!-- end api-info-block --> |
| 637 | |
| 638 | |
| 639 | <!-- ======== START OF CLASS DATA ======== --> |
| 640 | |
| 641 | <div id="jd-header"> |
| 642 | public |
| 643 | |
| 644 | final |
| 645 | |
| 646 | class |
| 647 | <h1 itemprop="name">CountingIdlingResource</h1> |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | extends Object<br/> |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | implements |
| 660 | |
| 661 | <a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html">IdlingResource</a> |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | |
| 668 | |
| 669 | |
| 670 | </div><!-- end header --> |
| 671 | |
| 672 | <div id="naMessage"></div> |
| 673 | |
| 674 | <div id="jd-content" class="api apilevel-"> |
| 675 | <table class="jd-inheritance-table"> |
| 676 | |
| 677 | |
| 678 | <tr> |
| 679 | |
| 680 | <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td> |
| 681 | </tr> |
| 682 | |
| 683 | |
| 684 | <tr> |
| 685 | |
| 686 | <td class="jd-inheritance-space"> ↳</td> |
| 687 | |
| 688 | <td colspan="1" class="jd-inheritance-class-cell">android.support.test.espresso.contrib.CountingIdlingResource</td> |
| 689 | </tr> |
| 690 | |
| 691 | |
| 692 | </table> |
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | <div class="jd-descr"> |
| 701 | |
| 702 | |
| 703 | <h2>Class Overview</h2> |
| 704 | <p itemprop="articleBody">An implementation of <code><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html">IdlingResource</a></code> that determines idleness by maintaining an internal |
| 705 | counter. When the counter is 0 - it is considered to be idle, when it is non-zero it is not |
| 706 | idle. This is very similar to the way a <code><a href="../../../../../../reference/java/util/concurrent/Semaphore.html">Semaphore</a></code> behaves. |
| 707 | <p> |
| 708 | The counter may be incremented or decremented from any thread. If it reaches an illogical state |
| 709 | (like counter less than zero) it will throw an IllegalStateException. |
| 710 | </p> |
| 711 | <p> |
| 712 | This class can then be used to wrap up operations that while in progress should block tests from |
| 713 | accessing the UI. |
| 714 | </p> |
| 715 | |
| 716 | <pre> |
| 717 | <code>public interface FooServer { |
| 718 | public Foo newFoo(); |
| 719 | public void updateFoo(Foo foo); |
| 720 | </code> |
| 721 | |
| 722 | public DecoratedFooServer implements FooServer { |
| 723 | private final FooServer realFooServer; |
| 724 | private final CountingIdlingResource fooServerIdlingResource; |
| 725 | |
| 726 | public DecoratedFooServer(FooServer realFooServer, |
| 727 | CountingIdlingResource fooServerIdlingResource) { |
| 728 | this.realFooServer = checkNotNull(realFooServer); |
| 729 | this.fooServerIdlingResource = checkNotNull(fooServerIdlingResource); |
| 730 | } |
| 731 | |
| 732 | public Foo newFoo() { |
| 733 | fooServerIdlingResource.increment(); |
| 734 | try { |
| 735 | return realFooServer.newFoo(); |
| 736 | } finally { |
| 737 | fooServerIdlingResource.decrement(); |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | public void updateFoo(Foo foo) { |
| 742 | fooServerIdlingResource.increment(); |
| 743 | try { |
| 744 | realFooServer.updateFoo(foo); |
| 745 | } finally { |
| 746 | fooServerIdlingResource.decrement(); |
| 747 | } |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | </pre> |
| 752 | |
| 753 | Then in your test setup: |
| 754 | <pre> |
| 755 | <code>public void setUp() throws Exception { |
| 756 | super.setUp(); |
| 757 | FooServer realServer = FooApplication.getFooServer(); |
| 758 | CountingIdlingResource countingResource = new CountingIdlingResource("FooServerCalls"); |
| 759 | FooApplication.setFooServer(new DecoratedFooServer(realServer, countingResource)); |
| 760 | Espresso.registerIdlingResource(countingResource); |
| 761 | </code> |
| 762 | } |
| 763 | </pre> |
| 764 | |
| 765 | </p> |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | </div><!-- jd-descr --> |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | |
| 787 | |
| 788 | <div class="jd-descr"> |
| 789 | |
| 790 | |
| 791 | <h2>Summary</h2> |
| 792 | |
| 793 | |
| 794 | |
| 795 | |
| 796 | |
| 797 | |
| 798 | |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | |
| 815 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| 816 | <table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | <tr class="alt-color api apilevel-" > |
| 822 | <td class="jd-typecol"><nobr> |
| 823 | |
| 824 | |
| 825 | |
| 826 | |
| 827 | |
| 828 | </nobr> |
| 829 | </td> |
| 830 | <td class="jd-linkcol" width="100%"><nobr> |
| 831 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#CountingIdlingResource(java.lang.String)">CountingIdlingResource</a></span>(String resourceName)</nobr> |
| 832 | |
| 833 | <div class="jd-descrdiv"> |
| 834 | Creates a CountingIdlingResource without debug tracing. |
| 835 | |
| 836 | |
| 837 | |
| 838 | </div> |
| 839 | |
| 840 | </td></tr> |
| 841 | |
| 842 | |
| 843 | |
| 844 | <tr class=" api apilevel-" > |
| 845 | <td class="jd-typecol"><nobr> |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | </nobr> |
| 852 | </td> |
| 853 | <td class="jd-linkcol" width="100%"><nobr> |
| 854 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#CountingIdlingResource(java.lang.String, boolean)">CountingIdlingResource</a></span>(String resourceName, boolean debugCounting)</nobr> |
| 855 | |
| 856 | <div class="jd-descrdiv"> |
| 857 | Creates a CountingIdlingResource. |
| 858 | |
| 859 | |
| 860 | |
| 861 | </div> |
| 862 | |
| 863 | </td></tr> |
| 864 | |
| 865 | |
| 866 | |
| 867 | </table> |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | <!-- ========== METHOD SUMMARY =========== --> |
| 875 | <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> |
| 876 | |
| 877 | |
| 878 | |
| 879 | |
| 880 | <tr class="alt-color api apilevel-" > |
| 881 | <td class="jd-typecol"><nobr> |
| 882 | |
| 883 | |
| 884 | |
| 885 | |
| 886 | |
| 887 | void</nobr> |
| 888 | </td> |
| 889 | <td class="jd-linkcol" width="100%"><nobr> |
| 890 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#decrement()">decrement</a></span>()</nobr> |
| 891 | |
| 892 | <div class="jd-descrdiv"> |
| 893 | Decrements the count of in-flight transactions to the resource being monitored. |
| 894 | |
| 895 | |
| 896 | |
| 897 | </div> |
| 898 | |
| 899 | </td></tr> |
| 900 | |
| 901 | |
| 902 | |
| 903 | <tr class=" api apilevel-" > |
| 904 | <td class="jd-typecol"><nobr> |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | void</nobr> |
| 911 | </td> |
| 912 | <td class="jd-linkcol" width="100%"><nobr> |
| 913 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#dumpStateToLogs()">dumpStateToLogs</a></span>()</nobr> |
| 914 | |
| 915 | <div class="jd-descrdiv"> |
| 916 | Prints the current state of this resource to the logcat at info level. |
| 917 | |
| 918 | |
| 919 | |
| 920 | </div> |
| 921 | |
| 922 | </td></tr> |
| 923 | |
| 924 | |
| 925 | |
| 926 | <tr class="alt-color api apilevel-" > |
| 927 | <td class="jd-typecol"><nobr> |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | String</nobr> |
| 934 | </td> |
| 935 | <td class="jd-linkcol" width="100%"><nobr> |
| 936 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#getName()">getName</a></span>()</nobr> |
| 937 | |
| 938 | <div class="jd-descrdiv"> |
| 939 | Returns the name of the resources (used for logging and idempotency of registration). |
| 940 | |
| 941 | |
| 942 | |
| 943 | </div> |
| 944 | |
| 945 | </td></tr> |
| 946 | |
| 947 | |
| 948 | |
| 949 | <tr class=" api apilevel-" > |
| 950 | <td class="jd-typecol"><nobr> |
| 951 | |
| 952 | |
| 953 | |
| 954 | |
| 955 | |
| 956 | void</nobr> |
| 957 | </td> |
| 958 | <td class="jd-linkcol" width="100%"><nobr> |
| 959 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#increment()">increment</a></span>()</nobr> |
| 960 | |
| 961 | <div class="jd-descrdiv"> |
| 962 | Increments the count of in-flight transactions to the resource being monitored. |
| 963 | |
| 964 | |
| 965 | |
| 966 | </div> |
| 967 | |
| 968 | </td></tr> |
| 969 | |
| 970 | |
| 971 | |
| 972 | <tr class="alt-color api apilevel-" > |
| 973 | <td class="jd-typecol"><nobr> |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | boolean</nobr> |
| 980 | </td> |
| 981 | <td class="jd-linkcol" width="100%"><nobr> |
| 982 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#isIdleNow()">isIdleNow</a></span>()</nobr> |
| 983 | |
| 984 | <div class="jd-descrdiv"> |
| 985 | Returns <code>true</code> if resource is currently idle. |
| 986 | |
| 987 | |
| 988 | |
| 989 | </div> |
| 990 | |
| 991 | </td></tr> |
| 992 | |
| 993 | |
| 994 | |
| 995 | <tr class=" api apilevel-" > |
| 996 | <td class="jd-typecol"><nobr> |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | void</nobr> |
| 1003 | </td> |
| 1004 | <td class="jd-linkcol" width="100%"><nobr> |
| 1005 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/contrib/CountingIdlingResource.html#registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback)">registerIdleTransitionCallback</a></span>(<a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a> resourceCallback)</nobr> |
| 1006 | |
| 1007 | <div class="jd-descrdiv"> |
| 1008 | Registers the given <code><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a></code> with the resource. |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | </div> |
| 1013 | |
| 1014 | </td></tr> |
| 1015 | |
| 1016 | |
| 1017 | |
| 1018 | </table> |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | <!-- ========== METHOD SUMMARY =========== --> |
| 1027 | <table id="inhmethods" class="jd-sumtable"><tr><th> |
| 1028 | <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> |
| 1029 | <div style="clear:left;">Inherited Methods</div></th></tr> |
| 1030 | |
| 1031 | |
| 1032 | <tr class="api apilevel-" > |
| 1033 | <td colspan="12"> |
| 1034 | <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" |
| 1035 | ><img id="inherited-methods-java.lang.Object-trigger" |
| 1036 | src="../../../../../../assets/images/triangle-closed.png" |
| 1037 | class="jd-expando-trigger-img" /></a> |
| 1038 | From class |
| 1039 | |
| 1040 | java.lang.Object |
| 1041 | |
| 1042 | <div id="inherited-methods-java.lang.Object"> |
| 1043 | <div id="inherited-methods-java.lang.Object-list" |
| 1044 | class="jd-inheritedlinks"> |
| 1045 | </div> |
| 1046 | <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> |
| 1047 | <table class="jd-sumtable-expando"> |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | <tr class="alt-color api apilevel-" > |
| 1053 | <td class="jd-typecol"><nobr> |
| 1054 | |
| 1055 | |
| 1056 | |
| 1057 | |
| 1058 | |
| 1059 | Object</nobr> |
| 1060 | </td> |
| 1061 | <td class="jd-linkcol" width="100%"><nobr> |
| 1062 | <span class="sympad">clone</span>()</nobr> |
| 1063 | |
| 1064 | </td></tr> |
| 1065 | |
| 1066 | |
| 1067 | |
| 1068 | <tr class=" api apilevel-" > |
| 1069 | <td class="jd-typecol"><nobr> |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | boolean</nobr> |
| 1076 | </td> |
| 1077 | <td class="jd-linkcol" width="100%"><nobr> |
| 1078 | <span class="sympad">equals</span>(Object arg0)</nobr> |
| 1079 | |
| 1080 | </td></tr> |
| 1081 | |
| 1082 | |
| 1083 | |
| 1084 | <tr class="alt-color api apilevel-" > |
| 1085 | <td class="jd-typecol"><nobr> |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | void</nobr> |
| 1092 | </td> |
| 1093 | <td class="jd-linkcol" width="100%"><nobr> |
| 1094 | <span class="sympad">finalize</span>()</nobr> |
| 1095 | |
| 1096 | </td></tr> |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | <tr class=" api apilevel-" > |
| 1101 | <td class="jd-typecol"><nobr> |
| 1102 | |
| 1103 | |
| 1104 | final |
| 1105 | |
| 1106 | |
| 1107 | Class<?></nobr> |
| 1108 | </td> |
| 1109 | <td class="jd-linkcol" width="100%"><nobr> |
| 1110 | <span class="sympad">getClass</span>()</nobr> |
| 1111 | |
| 1112 | </td></tr> |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | <tr class="alt-color api apilevel-" > |
| 1117 | <td class="jd-typecol"><nobr> |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | int</nobr> |
| 1124 | </td> |
| 1125 | <td class="jd-linkcol" width="100%"><nobr> |
| 1126 | <span class="sympad">hashCode</span>()</nobr> |
| 1127 | |
| 1128 | </td></tr> |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | <tr class=" api apilevel-" > |
| 1133 | <td class="jd-typecol"><nobr> |
| 1134 | |
| 1135 | |
| 1136 | final |
| 1137 | |
| 1138 | |
| 1139 | void</nobr> |
| 1140 | </td> |
| 1141 | <td class="jd-linkcol" width="100%"><nobr> |
| 1142 | <span class="sympad">notify</span>()</nobr> |
| 1143 | |
| 1144 | </td></tr> |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | <tr class="alt-color api apilevel-" > |
| 1149 | <td class="jd-typecol"><nobr> |
| 1150 | |
| 1151 | |
| 1152 | final |
| 1153 | |
| 1154 | |
| 1155 | void</nobr> |
| 1156 | </td> |
| 1157 | <td class="jd-linkcol" width="100%"><nobr> |
| 1158 | <span class="sympad">notifyAll</span>()</nobr> |
| 1159 | |
| 1160 | </td></tr> |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | <tr class=" api apilevel-" > |
| 1165 | <td class="jd-typecol"><nobr> |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | String</nobr> |
| 1172 | </td> |
| 1173 | <td class="jd-linkcol" width="100%"><nobr> |
| 1174 | <span class="sympad">toString</span>()</nobr> |
| 1175 | |
| 1176 | </td></tr> |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | <tr class="alt-color api apilevel-" > |
| 1181 | <td class="jd-typecol"><nobr> |
| 1182 | |
| 1183 | |
| 1184 | final |
| 1185 | |
| 1186 | |
| 1187 | void</nobr> |
| 1188 | </td> |
| 1189 | <td class="jd-linkcol" width="100%"><nobr> |
| 1190 | <span class="sympad">wait</span>()</nobr> |
| 1191 | |
| 1192 | </td></tr> |
| 1193 | |
| 1194 | |
| 1195 | |
| 1196 | <tr class=" api apilevel-" > |
| 1197 | <td class="jd-typecol"><nobr> |
| 1198 | |
| 1199 | |
| 1200 | final |
| 1201 | |
| 1202 | |
| 1203 | void</nobr> |
| 1204 | </td> |
| 1205 | <td class="jd-linkcol" width="100%"><nobr> |
| 1206 | <span class="sympad">wait</span>(long arg0, int arg1)</nobr> |
| 1207 | |
| 1208 | </td></tr> |
| 1209 | |
| 1210 | |
| 1211 | |
| 1212 | <tr class="alt-color api apilevel-" > |
| 1213 | <td class="jd-typecol"><nobr> |
| 1214 | |
| 1215 | |
| 1216 | final |
| 1217 | |
| 1218 | |
| 1219 | void</nobr> |
| 1220 | </td> |
| 1221 | <td class="jd-linkcol" width="100%"><nobr> |
| 1222 | <span class="sympad">wait</span>(long arg0)</nobr> |
| 1223 | |
| 1224 | </td></tr> |
| 1225 | |
| 1226 | |
| 1227 | </table> |
| 1228 | </div> |
| 1229 | </div> |
| 1230 | </td></tr> |
| 1231 | |
| 1232 | |
| 1233 | |
| 1234 | <tr class="api apilevel-" > |
| 1235 | <td colspan="12"> |
| 1236 | <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.espresso.IdlingResource" class="jd-expando-trigger closed" |
| 1237 | ><img id="inherited-methods-android.support.test.espresso.IdlingResource-trigger" |
| 1238 | src="../../../../../../assets/images/triangle-closed.png" |
| 1239 | class="jd-expando-trigger-img" /></a> |
| 1240 | From interface |
| 1241 | |
| 1242 | <a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html">android.support.test.espresso.IdlingResource</a> |
| 1243 | |
| 1244 | <div id="inherited-methods-android.support.test.espresso.IdlingResource"> |
| 1245 | <div id="inherited-methods-android.support.test.espresso.IdlingResource-list" |
| 1246 | class="jd-inheritedlinks"> |
| 1247 | </div> |
| 1248 | <div id="inherited-methods-android.support.test.espresso.IdlingResource-summary" style="display: none;"> |
| 1249 | <table class="jd-sumtable-expando"> |
| 1250 | |
| 1251 | |
| 1252 | |
| 1253 | |
| 1254 | <tr class="alt-color api apilevel-" > |
| 1255 | <td class="jd-typecol"><nobr> |
| 1256 | abstract |
| 1257 | |
| 1258 | |
| 1259 | |
| 1260 | |
| 1261 | String</nobr> |
| 1262 | </td> |
| 1263 | <td class="jd-linkcol" width="100%"><nobr> |
| 1264 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html#getName()">getName</a></span>()</nobr> |
| 1265 | |
| 1266 | <div class="jd-descrdiv"> |
| 1267 | Returns the name of the resources (used for logging and idempotency of registration). |
| 1268 | |
| 1269 | |
| 1270 | |
| 1271 | </div> |
| 1272 | |
| 1273 | </td></tr> |
| 1274 | |
| 1275 | |
| 1276 | |
| 1277 | <tr class=" api apilevel-" > |
| 1278 | <td class="jd-typecol"><nobr> |
| 1279 | abstract |
| 1280 | |
| 1281 | |
| 1282 | |
| 1283 | |
| 1284 | boolean</nobr> |
| 1285 | </td> |
| 1286 | <td class="jd-linkcol" width="100%"><nobr> |
| 1287 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html#isIdleNow()">isIdleNow</a></span>()</nobr> |
| 1288 | |
| 1289 | <div class="jd-descrdiv"> |
| 1290 | Returns <code>true</code> if resource is currently idle. |
| 1291 | |
| 1292 | |
| 1293 | |
| 1294 | </div> |
| 1295 | |
| 1296 | </td></tr> |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | <tr class="alt-color api apilevel-" > |
| 1301 | <td class="jd-typecol"><nobr> |
| 1302 | abstract |
| 1303 | |
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | void</nobr> |
| 1308 | </td> |
| 1309 | <td class="jd-linkcol" width="100%"><nobr> |
| 1310 | <span class="sympad"><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.html#registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback)">registerIdleTransitionCallback</a></span>(<a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a> callback)</nobr> |
| 1311 | |
| 1312 | <div class="jd-descrdiv"> |
| 1313 | Registers the given <code><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a></code> with the resource. |
| 1314 | |
| 1315 | |
| 1316 | |
| 1317 | </div> |
| 1318 | |
| 1319 | </td></tr> |
| 1320 | |
| 1321 | |
| 1322 | </table> |
| 1323 | </div> |
| 1324 | </div> |
| 1325 | </td></tr> |
| 1326 | |
| 1327 | |
| 1328 | </table> |
| 1329 | |
| 1330 | |
| 1331 | </div><!-- jd-descr (summary) --> |
| 1332 | |
| 1333 | <!-- Details --> |
| 1334 | |
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | <!-- XML Attributes --> |
| 1343 | |
| 1344 | |
| 1345 | <!-- Enum Values --> |
| 1346 | |
| 1347 | |
| 1348 | <!-- Constants --> |
| 1349 | |
| 1350 | |
| 1351 | <!-- Fields --> |
| 1352 | |
| 1353 | |
| 1354 | <!-- Public ctors --> |
| 1355 | |
| 1356 | |
| 1357 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| 1358 | <h2>Public Constructors</h2> |
| 1359 | |
| 1360 | |
| 1361 | |
| 1362 | <A NAME="CountingIdlingResource(java.lang.String)"></A> |
| 1363 | |
| 1364 | <div class="jd-details api apilevel-"> |
| 1365 | <h4 class="jd-details-title"> |
| 1366 | <span class="normal"> |
| 1367 | public |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | </span> |
| 1374 | <span class="sympad">CountingIdlingResource</span> |
| 1375 | <span class="normal">(String resourceName)</span> |
| 1376 | </h4> |
| 1377 | <div class="api-level"> |
| 1378 | <div></div> |
| 1379 | |
| 1380 | |
| 1381 | |
| 1382 | </div> |
| 1383 | <div class="jd-details-descr"> |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | <div class="jd-tagdata jd-tagdescr"><p>Creates a CountingIdlingResource without debug tracing.</p></div> |
| 1389 | <div class="jd-tagdata"> |
| 1390 | <h5 class="jd-tagtitle">Parameters</h5> |
| 1391 | <table class="jd-tagtable"> |
| 1392 | <tr> |
| 1393 | <th>resourceName</td> |
| 1394 | <td>the resource name this resource should report to Espresso. |
| 1395 | </td> |
| 1396 | </tr> |
| 1397 | </table> |
| 1398 | </div> |
| 1399 | |
| 1400 | </div> |
| 1401 | </div> |
| 1402 | |
| 1403 | |
| 1404 | <A NAME="CountingIdlingResource(java.lang.String, boolean)"></A> |
| 1405 | |
| 1406 | <div class="jd-details api apilevel-"> |
| 1407 | <h4 class="jd-details-title"> |
| 1408 | <span class="normal"> |
| 1409 | public |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | |
| 1415 | </span> |
| 1416 | <span class="sympad">CountingIdlingResource</span> |
| 1417 | <span class="normal">(String resourceName, boolean debugCounting)</span> |
| 1418 | </h4> |
| 1419 | <div class="api-level"> |
| 1420 | <div></div> |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | </div> |
| 1425 | <div class="jd-details-descr"> |
| 1426 | |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | <div class="jd-tagdata jd-tagdescr"><p>Creates a CountingIdlingResource.</p></div> |
| 1431 | <div class="jd-tagdata"> |
| 1432 | <h5 class="jd-tagtitle">Parameters</h5> |
| 1433 | <table class="jd-tagtable"> |
| 1434 | <tr> |
| 1435 | <th>resourceName</td> |
| 1436 | <td>the resource name this resource should report to Espresso.</td> |
| 1437 | </tr> |
| 1438 | <tr> |
| 1439 | <th>debugCounting</td> |
| 1440 | <td>if true increment & decrement calls will print trace information to logs. |
| 1441 | </td> |
| 1442 | </tr> |
| 1443 | </table> |
| 1444 | </div> |
| 1445 | |
| 1446 | </div> |
| 1447 | </div> |
| 1448 | |
| 1449 | |
| 1450 | |
| 1451 | |
| 1452 | |
| 1453 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| 1454 | <!-- Protected ctors --> |
| 1455 | |
| 1456 | |
| 1457 | |
| 1458 | <!-- ========= METHOD DETAIL ======== --> |
| 1459 | <!-- Public methdos --> |
| 1460 | |
| 1461 | <h2>Public Methods</h2> |
| 1462 | |
| 1463 | |
| 1464 | |
| 1465 | <A NAME="decrement()"></A> |
| 1466 | |
| 1467 | <div class="jd-details api apilevel-"> |
| 1468 | <h4 class="jd-details-title"> |
| 1469 | <span class="normal"> |
| 1470 | public |
| 1471 | |
| 1472 | |
| 1473 | |
| 1474 | |
| 1475 | void |
| 1476 | </span> |
| 1477 | <span class="sympad">decrement</span> |
| 1478 | <span class="normal">()</span> |
| 1479 | </h4> |
| 1480 | <div class="api-level"> |
| 1481 | <div></div> |
| 1482 | |
| 1483 | |
| 1484 | |
| 1485 | </div> |
| 1486 | <div class="jd-details-descr"> |
| 1487 | |
| 1488 | |
| 1489 | |
| 1490 | |
| 1491 | <div class="jd-tagdata jd-tagdescr"><p>Decrements the count of in-flight transactions to the resource being monitored. |
| 1492 | |
| 1493 | If this operation results in the counter falling below 0 - an exception is raised.</p></div> |
| 1494 | <div class="jd-tagdata"> |
| 1495 | <h5 class="jd-tagtitle">Throws</h5> |
| 1496 | <table class="jd-tagtable"> |
| 1497 | <tr> |
| 1498 | <th>IllegalStateException</td> |
| 1499 | <td>if the counter is below 0. |
| 1500 | </td> |
| 1501 | </tr> |
| 1502 | </table> |
| 1503 | </div> |
| 1504 | |
| 1505 | </div> |
| 1506 | </div> |
| 1507 | |
| 1508 | |
| 1509 | <A NAME="dumpStateToLogs()"></A> |
| 1510 | |
| 1511 | <div class="jd-details api apilevel-"> |
| 1512 | <h4 class="jd-details-title"> |
| 1513 | <span class="normal"> |
| 1514 | public |
| 1515 | |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | void |
| 1520 | </span> |
| 1521 | <span class="sympad">dumpStateToLogs</span> |
| 1522 | <span class="normal">()</span> |
| 1523 | </h4> |
| 1524 | <div class="api-level"> |
| 1525 | <div></div> |
| 1526 | |
| 1527 | |
| 1528 | |
| 1529 | </div> |
| 1530 | <div class="jd-details-descr"> |
| 1531 | |
| 1532 | |
| 1533 | |
| 1534 | |
| 1535 | <div class="jd-tagdata jd-tagdescr"><p>Prints the current state of this resource to the logcat at info level. |
| 1536 | </p></div> |
| 1537 | |
| 1538 | </div> |
| 1539 | </div> |
| 1540 | |
| 1541 | |
| 1542 | <A NAME="getName()"></A> |
| 1543 | |
| 1544 | <div class="jd-details api apilevel-"> |
| 1545 | <h4 class="jd-details-title"> |
| 1546 | <span class="normal"> |
| 1547 | public |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | |
| 1552 | String |
| 1553 | </span> |
| 1554 | <span class="sympad">getName</span> |
| 1555 | <span class="normal">()</span> |
| 1556 | </h4> |
| 1557 | <div class="api-level"> |
| 1558 | <div></div> |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | </div> |
| 1563 | <div class="jd-details-descr"> |
| 1564 | |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | <div class="jd-tagdata jd-tagdescr"><p>Returns the name of the resources (used for logging and idempotency of registration). |
| 1569 | </p></div> |
| 1570 | |
| 1571 | </div> |
| 1572 | </div> |
| 1573 | |
| 1574 | |
| 1575 | <A NAME="increment()"></A> |
| 1576 | |
| 1577 | <div class="jd-details api apilevel-"> |
| 1578 | <h4 class="jd-details-title"> |
| 1579 | <span class="normal"> |
| 1580 | public |
| 1581 | |
| 1582 | |
| 1583 | |
| 1584 | |
| 1585 | void |
| 1586 | </span> |
| 1587 | <span class="sympad">increment</span> |
| 1588 | <span class="normal">()</span> |
| 1589 | </h4> |
| 1590 | <div class="api-level"> |
| 1591 | <div></div> |
| 1592 | |
| 1593 | |
| 1594 | |
| 1595 | </div> |
| 1596 | <div class="jd-details-descr"> |
| 1597 | |
| 1598 | |
| 1599 | |
| 1600 | |
| 1601 | <div class="jd-tagdata jd-tagdescr"><p>Increments the count of in-flight transactions to the resource being monitored. |
| 1602 | |
| 1603 | This method can be called from any thread. |
| 1604 | </p></div> |
| 1605 | |
| 1606 | </div> |
| 1607 | </div> |
| 1608 | |
| 1609 | |
| 1610 | <A NAME="isIdleNow()"></A> |
| 1611 | |
| 1612 | <div class="jd-details api apilevel-"> |
| 1613 | <h4 class="jd-details-title"> |
| 1614 | <span class="normal"> |
| 1615 | public |
| 1616 | |
| 1617 | |
| 1618 | |
| 1619 | |
| 1620 | boolean |
| 1621 | </span> |
| 1622 | <span class="sympad">isIdleNow</span> |
| 1623 | <span class="normal">()</span> |
| 1624 | </h4> |
| 1625 | <div class="api-level"> |
| 1626 | <div></div> |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | </div> |
| 1631 | <div class="jd-details-descr"> |
| 1632 | |
| 1633 | |
| 1634 | |
| 1635 | |
| 1636 | <div class="jd-tagdata jd-tagdescr"><p>Returns <code>true</code> if resource is currently idle. Espresso will <b>always</b> call this |
| 1637 | method from the main thread, therefore it should be non-blocking and return immediately. |
| 1638 | </p></div> |
| 1639 | |
| 1640 | </div> |
| 1641 | </div> |
| 1642 | |
| 1643 | |
| 1644 | <A NAME="registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback)"></A> |
| 1645 | |
| 1646 | <div class="jd-details api apilevel-"> |
| 1647 | <h4 class="jd-details-title"> |
| 1648 | <span class="normal"> |
| 1649 | public |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | void |
| 1655 | </span> |
| 1656 | <span class="sympad">registerIdleTransitionCallback</span> |
| 1657 | <span class="normal">(<a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a> resourceCallback)</span> |
| 1658 | </h4> |
| 1659 | <div class="api-level"> |
| 1660 | <div></div> |
| 1661 | |
| 1662 | |
| 1663 | |
| 1664 | </div> |
| 1665 | <div class="jd-details-descr"> |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | <div class="jd-tagdata jd-tagdescr"><p>Registers the given <code><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a></code> with the resource. Espresso will call this method: |
| 1671 | <ul> |
| 1672 | <li>with its implementation of <code><a href="../../../../../../reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a></code> so it can be notified asynchronously |
| 1673 | that your resource is idle |
| 1674 | <li>from the main thread, but you are free to execute the callback's onTransitionToIdle from |
| 1675 | any thread |
| 1676 | <li>once (when it is initially given a reference to your IdlingResource) |
| 1677 | </ul> |
| 1678 | <br> |
| 1679 | You only need to call this upon transition from busy to idle - if the resource is already idle |
| 1680 | when the method is called invoking the call back is optional and has no significant impact. |
| 1681 | </p></div> |
| 1682 | |
| 1683 | </div> |
| 1684 | </div> |
| 1685 | |
| 1686 | |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | <!-- ========= METHOD DETAIL ======== --> |
| 1691 | |
| 1692 | |
| 1693 | |
| 1694 | <!-- ========= END OF CLASS DATA ========= --> |
| 1695 | <A NAME="navbar_top"></A> |
| 1696 | |
| 1697 | <div id="footer" class="wrap" > |
| 1698 | |
| 1699 | |
| 1700 | <div id="copyright"> |
| 1701 | |
| 1702 | Except as noted, this content is licensed under <a |
| 1703 | href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>. |
| 1704 | For details and restrictions, see the <a href="../../../../../../license.html"> |
| 1705 | Content License</a>. |
| 1706 | </div> |
| 1707 | <div id="build_info"> |
| 1708 | |
| 1709 | Android r — |
| 1710 | <script src="../../../../../../timestamp.js" type="text/javascript"></script> |
| 1711 | <script>document.write(BUILD_TIMESTAMP)</script> |
| 1712 | |
| 1713 | </div> |
| 1714 | |
| 1715 | |
| 1716 | <div id="footerlinks"> |
| 1717 | |
| 1718 | <p> |
| 1719 | <a href="../../../../../../about/index.html">About Android</a> | |
| 1720 | <a href="../../../../../../legal.html">Legal</a> | |
| 1721 | <a href="../../../../../../support.html">Support</a> |
| 1722 | </p> |
| 1723 | </div> |
| 1724 | |
| 1725 | </div> <!-- end footer --> |
| 1726 | </div> <!-- jd-content --> |
| 1727 | |
| 1728 | </div><!-- end doc-content --> |
| 1729 | |
| 1730 | </div> <!-- end body-content --> |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | |
| 1737 | </body> |
| 1738 | </html> |