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<html> 97<head> 98 99 100<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 101<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> 102<meta content="IE=edge" http-equiv="X-UA-Compatible"> 103 104<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" /> 105<title>InstrumentationRegistry | Android Developers</title> 106 107<!-- STYLESHEETS --> 108<link rel="stylesheet" 109href="http://fonts.googleapis.com/css?family=Roboto+Condensed"> 110<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" 111 title="roboto"> 112 113<link href="../../../../assets/css/default.css?v=7" 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=5" type="text/javascript"></script> 130 131 132 133<script> 134 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 135 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 136 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 137 })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 138 139 ga('create', 'UA-5831155-1', 'android.com'); 140 ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker); 141 ga('send', 'pageview'); 142 ga('universal.send', 'pageview'); // Send page view for new tracker. 143</script> 144 145</head> 146 147<body class="gc-documentation 148 develop reference" itemscope itemtype="http://schema.org/Article"> 149 <div id="doc-api-level" class="" style="display:none"></div> 150 <a name="top"></a> 151 152<a name="top"></a> 153 154<!-- dialog to prompt lang pref change when loaded from hardcoded URL 155<div id="langMessage" style="display:none"> 156 <div> 157 <div class="lang en"> 158 <p>You requested a page in English, would you like to proceed with this language setting?</p> 159 </div> 160 <div class="lang es"> 161 <p>You requested a page in Spanish (Español), would you like to proceed with this language setting?</p> 162 </div> 163 <div class="lang ja"> 164 <p>You requested a page in Japanese (日本語), would you like to proceed with this language setting?</p> 165 </div> 166 <div class="lang ko"> 167 <p>You requested a page in Korean (한국어), would you like to proceed with this language setting?</p> 168 </div> 169 <div class="lang ru"> 170 <p>You requested a page in Russian (Русский), would you like to proceed with this language setting?</p> 171 </div> 172 <div class="lang zh-cn"> 173 <p>You requested a page in Simplified Chinese (简体中文), would you like to proceed with this language setting?</p> 174 </div> 175 <div class="lang zh-tw"> 176 <p>You requested a page in Traditional Chinese (繁體中文), would you like to proceed with this language setting?</p> 177 </div> 178 <a href="#" class="button yes" onclick="return false;"> 179 <span class="lang en">Yes</span> 180 <span class="lang es">Sí</span> 181 <span class="lang ja">Yes</span> 182 <span class="lang ko">Yes</span> 183 <span class="lang ru">Yes</span> 184 <span class="lang zh-cn">是的</span> 185 <span class="lang zh-tw">没有</span> 186 </a> 187 <a href="#" class="button" onclick="$('#langMessage').hide();return false;"> 188 <span class="lang en">No</span> 189 <span class="lang es">No</span> 190 <span class="lang ja">No</span> 191 <span class="lang ko">No</span> 192 <span class="lang ru">No</span> 193 <span class="lang zh-cn">没有</span> 194 <span class="lang zh-tw">没有</span> 195 </a> 196 </div> 197</div> --> 198 199 200 <!-- Header --> 201 <div id="header-wrapper"> 202 <div class="dac-header" id="header"> 203 204 205 206 207 <div class="dac-header-inner"> 208 <a class="dac-nav-toggle" data-dac-toggle-nav href="javascript:;" title="Open navigation"> 209 <span class="dac-nav-hamburger"> 210 <span class="dac-nav-hamburger-top"></span> 211 <span class="dac-nav-hamburger-mid"></span> 212 <span class="dac-nav-hamburger-bot"></span> 213 </span> 214 </a> 215 <a class="dac-header-logo" href="../../../../index.html"> 216 <img class="dac-header-logo-image" src="../../../../assets/images/android_logo.png" 217 srcset="../../../../assets/images/android_logo@2x.png 2x" 218 width="32" height="36" alt="Android" /> Developers 219 </a> 220 221 <ul class="dac-header-crumbs"> 222 223 <li class="dac-header-crumbs-item"><span class="dac-header-crumbs-link current ">InstrumentationRegistry</a></li> 224 </ul> 225 226 227 228 229 <div class="dac-header-search" id="search-container"> 230 <div class="dac-header-search-inner"> 231 <div class="dac-sprite dac-search dac-header-search-btn" id="search-btn"></div> 232 <form class="dac-header-search-form" onsubmit="return submit_search()"> 233 <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q" 234 onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)" 235 onkeydown="return search_changed(event, true, '../../../../')" 236 onkeyup="return search_changed(event, false, '../../../../')" 237 class="dac-header-search-input" placeholder="Search" /> 238 <a class="dac-header-search-close hide" id="search-close">close</a> 239 </form> 240 </div><!-- end dac-header-search-inner --> 241 </div><!-- end dac-header-search --> 242 243 <div class="search_filtered_wrapper"> 244 <div class="suggest-card reference no-display"> 245 <ul class="search_filtered"> 246 </ul> 247 </div> 248 <div class="suggest-card develop no-display"> 249 <ul class="search_filtered"> 250 </ul> 251 <div class="child-card guides no-display"> 252 </div> 253 <div class="child-card training no-display"> 254 </div> 255 <div class="child-card samples no-display"> 256 </div> 257 </div> 258 <div class="suggest-card design no-display"> 259 <ul class="search_filtered"> 260 </ul> 261 </div> 262 <div class="suggest-card distribute no-display"> 263 <ul class="search_filtered"> 264 </ul> 265 </div> 266 </div> 267 268 269 270 <a class="dac-header-console-btn" href="https://play.google.com/apps/publish/"> 271 <span class="dac-sprite dac-google-play"></span> 272 <span class="dac-visible-desktop-inline">Developer</span> 273 Console 274 </a> 275 276 </div><!-- end header-wrap.wrap --> 277 </div><!-- end header --> 278 279 <div id="searchResults" class="wrap" style="display:none;"> 280 <h2 id="searchTitle">Results</h2> 281 <div id="leftSearchControl" class="search-control">Loading...</div> 282 </div> 283 </div> <!--end header-wrapper --> 284 285 286 <!-- Navigation--> 287 <nav class="dac-nav"> 288 <div class="dac-nav-dimmer" data-dac-toggle-nav></div> 289 290 <ul class="dac-nav-list" data-dac-nav> 291 <li class="dac-nav-item dac-nav-head"> 292 <a class="dac-nav-link dac-nav-logo" data-dac-toggle-nav href="javascript:;" title="Close navigation"> 293 <img class="dac-logo-image" src="../../../../assets/images/android_logo.png" 294 srcset="../../../../assets/images/android_logo@2x.png 2x" 295 width="32" height="36" alt="Android" /> Developers 296 </a> 297 </li> 298 <li class="dac-nav-item home"> 299 <a class="dac-nav-link dac-visible-mobile-block" href="../../../../index.html">Home</a> 300 <ul class="dac-nav-secondary about"> 301 <li class="dac-nav-item about"> 302 <a class="dac-nav-link" href="../../../../about/index.html">Android</a> 303 </li> 304 <li class="dac-nav-item wear"> 305 <a class="dac-nav-link" href="../../../../wear/index.html">Wear</a> 306 </li> 307 <li class="dac-nav-item tv"> 308 <a class="dac-nav-link" href="../../../../tv/index.html">TV</a> 309 </li> 310 <li class="dac-nav-item auto"> 311 <a class="dac-nav-link" href="../../../../auto/index.html">Auto</a> 312 </li> 313 </ul> 314 </li> 315 <li class="dac-nav-item design"> 316 <a class="dac-nav-link" href="../../../../design/index.html" 317 zh-tw-lang="設計" 318 zh-cn-lang="设计" 319 ru-lang="Проектирование" 320 ko-lang="디자인" 321 ja-lang="設計" 322 es-lang="Diseñar">Design</a> 323 </li> 324 <li class="dac-nav-item develop"> 325 <a class="dac-nav-link" href="../../../../develop/index.html" 326 zh-tw-lang="開發" 327 zh-cn-lang="开发" 328 ru-lang="Разработка" 329 ko-lang="개발" 330 ja-lang="開発" 331 es-lang="Desarrollar">Develop</a> 332 <ul class="dac-nav-secondary develop"> 333 <li class="dac-nav-item training"> 334 <a class="dac-nav-link" href="../../../../training/index.html" 335 zh-tw-lang="訓練課程" 336 zh-cn-lang="培训" 337 ru-lang="Курсы" 338 ko-lang="교육" 339 ja-lang="トレーニング" 340 es-lang="Capacitación">Training</a> 341 </li> 342 <li class="dac-nav-item guide"> 343 <a class="dac-nav-link" href="../../../../guide/index.html" 344 zh-tw-lang="API 指南" 345 zh-cn-lang="API 指南" 346 ru-lang="Руководства по API" 347 ko-lang="API 가이드" 348 ja-lang="API ガイド" 349 es-lang="Guías de la API">API Guides</a> 350 </li> 351 <li class="dac-nav-item reference"> 352 <a class="dac-nav-link" href="../../../../reference/packages.html" 353 zh-tw-lang="參考資源" 354 zh-cn-lang="参考" 355 ru-lang="Справочник" 356 ko-lang="참조문서" 357 ja-lang="リファレンス" 358 es-lang="Referencia">Reference</a> 359 </li> 360 <li class="dac-nav-item tools"> 361 <a class="dac-nav-link" href="../../../../sdk/index.html" 362 zh-tw-lang="相關工具" 363 zh-cn-lang="工具" 364 ru-lang="Инструменты" 365 ko-lang="도구" 366 ja-lang="ツール" 367 es-lang="Herramientas">Tools</a></li> 368 <li class="dac-nav-item google"> 369 <a class="dac-nav-link" href="../../../../google/index.html">Google Services</a> 370 </li> 371 372 <li class="dac-nav-item preview"> 373 <a class="dac-nav-link" href="../../../../preview/index.html">Preview</a> 374 </li> 375 </ul> 376 </li> 377 <li class="dac-nav-item distribute"> 378 <a class="dac-nav-link" href="../../../../distribute/index.html" 379 zh-tw-lang="發佈" 380 zh-cn-lang="分发" 381 ru-lang="Распространение" 382 ko-lang="배포" 383 ja-lang="配布" 384 es-lang="Distribuir">Distribute</a> 385 <ul class="dac-nav-secondary distribute"> 386 <li class="dac-nav-item googleplay"> 387 <a class="dac-nav-link" href="../../../../distribute/googleplay/index.html">Google Play</a></li> 388 <li class="dac-nav-item essentials"> 389 <a class="dac-nav-link" href="../../../../distribute/essentials/index.html">Essentials</a></li> 390 <li class="dac-nav-item users"> 391 <a class="dac-nav-link" href="../../../../distribute/users/index.html">Get Users</a></li> 392 <li class="dac-nav-item engage"> 393 <a class="dac-nav-link" href="../../../../distribute/engage/index.html">Engage & Retain</a></li> 394 <li class="dac-nav-item monetize"> 395 <a class="dac-nav-link" href="../../../../distribute/monetize/index.html">Earn</a> 396 </li> 397 <li class="dac-nav-item analyze"> 398 <a class="dac-nav-link" href="../../../../distribute/analyze/index.html">Analyze</a> 399 </li> 400 <li class="dac-nav-item stories"> 401 <a class="dac-nav-link" href="../../../../distribute/stories/index.html">Stories</a> 402 </li> 403 </ul> 404 </li> 405 </ul> 406 </nav> 407 <!-- end navigation--> 408 409 410 411 412 413 414 <div class="wrap clearfix" id="body-content"><div class="cols"> 415 <div class="col-4 dac-hidden-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement"> 416 <div id="devdoc-nav"> 417 <div id="api-nav-header"> 418 <div id="api-level-toggle"> 419 <label for="apiLevelCheckbox" class="disabled" 420 title="Select your target API level to dim unavailable APIs">API level: </label> 421 <div class="select-wrapper"> 422 <select id="apiLevelSelector"> 423 <!-- option elements added by buildApiLevelSelector() --> 424 </select> 425 </div> 426 </div><!-- end toggle --> 427 <div id="api-nav-title">Android APIs</div> 428 </div><!-- end nav header --> 429 <script> 430 var SINCE_DATA = [ ]; 431 buildApiLevelSelector(); 432 </script> 433 434 <div id="swapper"> 435 <div id="nav-panels"> 436 <div id="resize-packages-nav"> 437 <div id="packages-nav" class="scroll-pane"> 438 439 <ul> 440 441 <li class="selected api apilevel-"> 442 <a href="../../../../reference/android/support/test/package-summary.html">android.support.test</a></li> 443 <li class="api apilevel-"> 444 <a href="../../../../reference/android/support/test/annotation/package-summary.html">android.support.test.annotation</a></li> 445 <li class="api apilevel-"> 446 <a href="../../../../reference/android/support/test/espresso/package-summary.html">android.support.test.espresso</a></li> 447 <li class="api apilevel-"> 448 <a href="../../../../reference/android/support/test/espresso/action/package-summary.html">android.support.test.espresso.action</a></li> 449 <li class="api apilevel-"> 450 <a href="../../../../reference/android/support/test/espresso/assertion/package-summary.html">android.support.test.espresso.assertion</a></li> 451 <li class="api apilevel-"> 452 <a href="../../../../reference/android/support/test/espresso/base/package-summary.html">android.support.test.espresso.base</a></li> 453 <li class="api apilevel-"> 454 <a href="../../../../reference/android/support/test/espresso/contrib/package-summary.html">android.support.test.espresso.contrib</a></li> 455 <li class="api apilevel-"> 456 <a href="../../../../reference/android/support/test/espresso/intent/package-summary.html">android.support.test.espresso.intent</a></li> 457 <li class="api apilevel-"> 458 <a href="../../../../reference/android/support/test/espresso/intent/matcher/package-summary.html">android.support.test.espresso.intent.matcher</a></li> 459 <li class="api apilevel-"> 460 <a href="../../../../reference/android/support/test/espresso/intent/rule/package-summary.html">android.support.test.espresso.intent.rule</a></li> 461 <li class="api apilevel-"> 462 <a href="../../../../reference/android/support/test/espresso/matcher/package-summary.html">android.support.test.espresso.matcher</a></li> 463 <li class="api apilevel-"> 464 <a href="../../../../reference/android/support/test/espresso/util/package-summary.html">android.support.test.espresso.util</a></li> 465 <li class="api apilevel-"> 466 <a href="../../../../reference/android/support/test/espresso/web/action/package-summary.html">android.support.test.espresso.web.action</a></li> 467 <li class="api apilevel-"> 468 <a href="../../../../reference/android/support/test/espresso/web/assertion/package-summary.html">android.support.test.espresso.web.assertion</a></li> 469 <li class="api apilevel-"> 470 <a href="../../../../reference/android/support/test/espresso/web/bridge/package-summary.html">android.support.test.espresso.web.bridge</a></li> 471 <li class="api apilevel-"> 472 <a href="../../../../reference/android/support/test/espresso/web/matcher/package-summary.html">android.support.test.espresso.web.matcher</a></li> 473 <li class="api apilevel-"> 474 <a href="../../../../reference/android/support/test/espresso/web/model/package-summary.html">android.support.test.espresso.web.model</a></li> 475 <li class="api apilevel-"> 476 <a href="../../../../reference/android/support/test/espresso/web/sugar/package-summary.html">android.support.test.espresso.web.sugar</a></li> 477 <li class="api apilevel-"> 478 <a href="../../../../reference/android/support/test/espresso/web/webdriver/package-summary.html">android.support.test.espresso.web.webdriver</a></li> 479 <li class="api apilevel-"> 480 <a href="../../../../reference/android/support/test/filters/package-summary.html">android.support.test.filters</a></li> 481 <li class="api apilevel-"> 482 <a href="../../../../reference/android/support/test/rule/package-summary.html">android.support.test.rule</a></li> 483 <li class="api apilevel-"> 484 <a href="../../../../reference/android/support/test/runner/package-summary.html">android.support.test.runner</a></li> 485 <li class="api apilevel-"> 486 <a href="../../../../reference/android/support/test/runner/intent/package-summary.html">android.support.test.runner.intent</a></li> 487 <li class="api apilevel-"> 488 <a href="../../../../reference/android/support/test/runner/lifecycle/package-summary.html">android.support.test.runner.lifecycle</a></li> 489 <li class="api apilevel-"> 490 <a href="../../../../reference/android/support/test/uiautomator/package-summary.html">android.support.test.uiautomator</a></li> 491 </ul><br/> 492 493 </div> <!-- end packages-nav --> 494 </div> <!-- end resize-packages --> 495 <div id="classes-nav" class="scroll-pane"> 496 497 498 499 <ul> 500 501 502 503 <li><h2>Classes</h2> 504 <ul> 505 <li class="selected api apilevel-"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html">InstrumentationRegistry</a></li> 506 </ul> 507 </li> 508 509 510 511 </ul><br/> 512 513 514 </div><!-- end classes --> 515 </div><!-- end nav-panels --> 516 <div id="nav-tree" style="display:none" class="scroll-pane"> 517 <div id="tree-list"></div> 518 </div><!-- end nav-tree --> 519 </div><!-- end swapper --> 520 <div id="nav-swap"> 521 <a class="fullscreen">fullscreen</a> 522 <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> 523 </div> 524 </div> <!-- end devdoc-nav --> 525 </div> <!-- end side-nav --> 526 <script type="text/javascript"> 527 // init fullscreen based on user pref 528 var fullscreen = readCookie("fullscreen"); 529 if (fullscreen != 0) { 530 if (fullscreen == "false") { 531 toggleFullscreen(false); 532 } else { 533 toggleFullscreen(true); 534 } 535 } 536 // init nav version for mobile 537 if (isMobile) { 538 swapNav(); // tree view should be used on mobile 539 $('#nav-swap').hide(); 540 } else { 541 chooseDefaultNav(); 542 if ($("#nav-tree").is(':visible')) { 543 init_default_navtree("../../../../"); 544 } 545 } 546 // scroll the selected page into view 547 $(document).ready(function() { 548 scrollIntoView("packages-nav"); 549 scrollIntoView("classes-nav"); 550 }); 551 </script> 552 553 554 555 556 557<div class="col-12" id="doc-col"> 558 559<div id="api-info-block"> 560 561 562 563 564 565 566 567 568 569 570 571<div class="sum-details-links"> 572 573Summary: 574 575 576 577 578 579 580 581 582 583 584 585 <a href="#pubmethods">Methods</a> 586 587 588 589 590 | <a href="#inhmethods">Inherited Methods</a> 591 592| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 593 594</div><!-- end sum-details-links --> 595<div class="api-level"> 596 597 598 599 600</div> 601</div><!-- end api-info-block --> 602 603 604<!-- ======== START OF CLASS DATA ======== --> 605 606<div id="jd-header"> 607 public 608 609 final 610 611 class 612<h1 itemprop="name">InstrumentationRegistry</h1> 613 614 615 616 617 extends Object<br/> 618 619 620 621 622 623 624 625 626 627 628 629 630</div><!-- end header --> 631 632<div id="naMessage"></div> 633 634<div id="jd-content" class="api apilevel-"> 635<table class="jd-inheritance-table"> 636 637 638 <tr> 639 640 <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td> 641 </tr> 642 643 644 <tr> 645 646 <td class="jd-inheritance-space"> ↳</td> 647 648 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.InstrumentationRegistry</td> 649 </tr> 650 651 652</table> 653 654 655 656 657 658 659 660<div class="jd-descr"> 661 662 663<h2>Class Overview</h2> 664<p itemprop="articleBody">An exposed registry instance that holds a reference to the instrumentation running in the 665 process and it's arguments. Also provides an easy way for callers to get a hold of 666 instrumentation, application context and instrumentation arguments Bundle. 667</p> 668 669 670 671 672 673</div><!-- jd-descr --> 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690<div class="jd-descr"> 691 692 693<h2>Summary</h2> 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721<!-- ========== METHOD SUMMARY =========== --> 722<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> 723 724 725 726 727 <tr class="alt-color api apilevel-" > 728 <td class="jd-typecol"><nobr> 729 730 731 732 static 733 734 Bundle</nobr> 735 </td> 736 <td class="jd-linkcol" width="100%"><nobr> 737 <span class="sympad"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html#getArguments()">getArguments</a></span>()</nobr> 738 739 <div class="jd-descrdiv"> 740 Returns a copy of instrumentation arguments Bundle. 741 742 743 744 </div> 745 746 </td></tr> 747 748 749 750 <tr class=" api apilevel-" > 751 <td class="jd-typecol"><nobr> 752 753 754 755 static 756 757 Context</nobr> 758 </td> 759 <td class="jd-linkcol" width="100%"><nobr> 760 <span class="sympad"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html#getContext()">getContext</a></span>()</nobr> 761 762 <div class="jd-descrdiv"> 763 Return the Context of this instrumentation's package. 764 765 766 767 </div> 768 769 </td></tr> 770 771 772 773 <tr class="alt-color api apilevel-" > 774 <td class="jd-typecol"><nobr> 775 776 777 778 static 779 780 Instrumentation</nobr> 781 </td> 782 <td class="jd-linkcol" width="100%"><nobr> 783 <span class="sympad"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html#getInstrumentation()">getInstrumentation</a></span>()</nobr> 784 785 <div class="jd-descrdiv"> 786 Returns the instrumentation currently running. 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 static 802 803 Context</nobr> 804 </td> 805 <td class="jd-linkcol" width="100%"><nobr> 806 <span class="sympad"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html#getTargetContext()">getTargetContext</a></span>()</nobr> 807 808 <div class="jd-descrdiv"> 809 Return a Context for the target application being instrumented. 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 static 825 826 void</nobr> 827 </td> 828 <td class="jd-linkcol" width="100%"><nobr> 829 <span class="sympad"><a href="../../../../reference/android/support/test/InstrumentationRegistry.html#registerInstance(android.app.Instrumentation, android.os.Bundle)">registerInstance</a></span>(Instrumentation instrumentation, Bundle arguments)</nobr> 830 831 <div class="jd-descrdiv"> 832 Records/exposes the instrumentation currently running and stores a copy of the 833 instrumentation arguments Bundle in the registry. 834 835 836 837 </div> 838 839 </td></tr> 840 841 842 843</table> 844 845 846 847 848 849 850 851<!-- ========== METHOD SUMMARY =========== --> 852<table id="inhmethods" class="jd-sumtable"><tr><th> 853 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> 854 <div style="clear:left;">Inherited Methods</div></th></tr> 855 856 857<tr class="api apilevel-" > 858<td colspan="12"> 859 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 860 ><img id="inherited-methods-java.lang.Object-trigger" 861 src="../../../../assets/images/triangle-closed.png" 862 class="jd-expando-trigger-img" /></a> 863From class 864 865 java.lang.Object 866 867<div id="inherited-methods-java.lang.Object"> 868 <div id="inherited-methods-java.lang.Object-list" 869 class="jd-inheritedlinks"> 870 </div> 871 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 872 <table class="jd-sumtable-expando"> 873 874 875 876 877 <tr class="alt-color api apilevel-" > 878 <td class="jd-typecol"><nobr> 879 880 881 882 883 884 Object</nobr> 885 </td> 886 <td class="jd-linkcol" width="100%"><nobr> 887 <span class="sympad">clone</span>()</nobr> 888 889 </td></tr> 890 891 892 893 <tr class=" api apilevel-" > 894 <td class="jd-typecol"><nobr> 895 896 897 898 899 900 boolean</nobr> 901 </td> 902 <td class="jd-linkcol" width="100%"><nobr> 903 <span class="sympad">equals</span>(Object arg0)</nobr> 904 905 </td></tr> 906 907 908 909 <tr class="alt-color api apilevel-" > 910 <td class="jd-typecol"><nobr> 911 912 913 914 915 916 void</nobr> 917 </td> 918 <td class="jd-linkcol" width="100%"><nobr> 919 <span class="sympad">finalize</span>()</nobr> 920 921 </td></tr> 922 923 924 925 <tr class=" api apilevel-" > 926 <td class="jd-typecol"><nobr> 927 928 929 final 930 931 932 Class<?></nobr> 933 </td> 934 <td class="jd-linkcol" width="100%"><nobr> 935 <span class="sympad">getClass</span>()</nobr> 936 937 </td></tr> 938 939 940 941 <tr class="alt-color api apilevel-" > 942 <td class="jd-typecol"><nobr> 943 944 945 946 947 948 int</nobr> 949 </td> 950 <td class="jd-linkcol" width="100%"><nobr> 951 <span class="sympad">hashCode</span>()</nobr> 952 953 </td></tr> 954 955 956 957 <tr class=" api apilevel-" > 958 <td class="jd-typecol"><nobr> 959 960 961 final 962 963 964 void</nobr> 965 </td> 966 <td class="jd-linkcol" width="100%"><nobr> 967 <span class="sympad">notify</span>()</nobr> 968 969 </td></tr> 970 971 972 973 <tr class="alt-color api apilevel-" > 974 <td class="jd-typecol"><nobr> 975 976 977 final 978 979 980 void</nobr> 981 </td> 982 <td class="jd-linkcol" width="100%"><nobr> 983 <span class="sympad">notifyAll</span>()</nobr> 984 985 </td></tr> 986 987 988 989 <tr class=" api apilevel-" > 990 <td class="jd-typecol"><nobr> 991 992 993 994 995 996 String</nobr> 997 </td> 998 <td class="jd-linkcol" width="100%"><nobr> 999 <span class="sympad">toString</span>()</nobr> 1000 1001 </td></tr> 1002 1003 1004 1005 <tr class="alt-color api apilevel-" > 1006 <td class="jd-typecol"><nobr> 1007 1008 1009 final 1010 1011 1012 void</nobr> 1013 </td> 1014 <td class="jd-linkcol" width="100%"><nobr> 1015 <span class="sympad">wait</span>()</nobr> 1016 1017 </td></tr> 1018 1019 1020 1021 <tr class=" api apilevel-" > 1022 <td class="jd-typecol"><nobr> 1023 1024 1025 final 1026 1027 1028 void</nobr> 1029 </td> 1030 <td class="jd-linkcol" width="100%"><nobr> 1031 <span class="sympad">wait</span>(long arg0, int arg1)</nobr> 1032 1033 </td></tr> 1034 1035 1036 1037 <tr class="alt-color api apilevel-" > 1038 <td class="jd-typecol"><nobr> 1039 1040 1041 final 1042 1043 1044 void</nobr> 1045 </td> 1046 <td class="jd-linkcol" width="100%"><nobr> 1047 <span class="sympad">wait</span>(long arg0)</nobr> 1048 1049 </td></tr> 1050 1051 1052</table> 1053 </div> 1054</div> 1055</td></tr> 1056 1057 1058</table> 1059 1060 1061</div><!-- jd-descr (summary) --> 1062 1063<!-- Details --> 1064 1065 1066 1067 1068 1069 1070 1071 1072<!-- XML Attributes --> 1073 1074 1075<!-- Enum Values --> 1076 1077 1078<!-- Constants --> 1079 1080 1081<!-- Fields --> 1082 1083 1084<!-- Public ctors --> 1085 1086 1087 1088<!-- ========= CONSTRUCTOR DETAIL ======== --> 1089<!-- Protected ctors --> 1090 1091 1092 1093<!-- ========= METHOD DETAIL ======== --> 1094<!-- Public methdos --> 1095 1096<h2>Public Methods</h2> 1097 1098 1099 1100<A NAME="getArguments()"></A> 1101 1102<div class="jd-details api apilevel-"> 1103 <h4 class="jd-details-title"> 1104 <span class="normal"> 1105 public 1106 static 1107 1108 1109 1110 Bundle 1111 </span> 1112 <span class="sympad">getArguments</span> 1113 <span class="normal">()</span> 1114 </h4> 1115 <div class="api-level"> 1116 <div></div> 1117 1118 1119 1120 </div> 1121 <div class="jd-details-descr"> 1122 1123 1124 1125 1126 <div class="jd-tagdata jd-tagdescr"><p>Returns a copy of instrumentation arguments Bundle. Use this to get a <code><a href="../../../../reference/android/os/Bundle.html">Bundle</a></code> 1127 containing the command line arguments passed to <code><a href="../../../../reference/android/app/Instrumentation.html">Instrumentation</a></code> into your test. 1128 <p> 1129 This Bundle is not guaranteed to be present under all instrumentations. 1130 </p></p></div> 1131 <div class="jd-tagdata"> 1132 <h5 class="jd-tagtitle">Returns</h5> 1133 <ul class="nolist"><li>Bundle the arguments for this instrumentation.</li></ul> 1134 </div> 1135 <div class="jd-tagdata"> 1136 <h5 class="jd-tagtitle">Throws</h5> 1137 <table class="jd-tagtable"> 1138 <tr> 1139 <th>IllegalStateException</td> 1140 <td>if no argument Bundle has been registered. 1141</td> 1142 </tr> 1143 </table> 1144 </div> 1145 1146 </div> 1147</div> 1148 1149 1150<A NAME="getContext()"></A> 1151 1152<div class="jd-details api apilevel-"> 1153 <h4 class="jd-details-title"> 1154 <span class="normal"> 1155 public 1156 static 1157 1158 1159 1160 Context 1161 </span> 1162 <span class="sympad">getContext</span> 1163 <span class="normal">()</span> 1164 </h4> 1165 <div class="api-level"> 1166 <div></div> 1167 1168 1169 1170 </div> 1171 <div class="jd-details-descr"> 1172 1173 1174 1175 1176 <div class="jd-tagdata jd-tagdescr"><p>Return the Context of this instrumentation's package. Use this to get a 1177 <code><a href="../../../../reference/android/content/Context.html">Context</a></code> representing <code><a href="../../../../reference/android/app/Instrumentation.html#getContext()">getContext()</a></code> into your test. 1178</p></div> 1179 1180 </div> 1181</div> 1182 1183 1184<A NAME="getInstrumentation()"></A> 1185 1186<div class="jd-details api apilevel-"> 1187 <h4 class="jd-details-title"> 1188 <span class="normal"> 1189 public 1190 static 1191 1192 1193 1194 Instrumentation 1195 </span> 1196 <span class="sympad">getInstrumentation</span> 1197 <span class="normal">()</span> 1198 </h4> 1199 <div class="api-level"> 1200 <div></div> 1201 1202 1203 1204 </div> 1205 <div class="jd-details-descr"> 1206 1207 1208 1209 1210 <div class="jd-tagdata jd-tagdescr"><p>Returns the instrumentation currently running. Use this to get an <code><a href="../../../../reference/android/app/Instrumentation.html">Instrumentation</a></code> 1211 into your test.</p></div> 1212 <div class="jd-tagdata"> 1213 <h5 class="jd-tagtitle">Throws</h5> 1214 <table class="jd-tagtable"> 1215 <tr> 1216 <th>IllegalStateException</td> 1217 <td>if instrumentation hasn't been registered 1218</td> 1219 </tr> 1220 </table> 1221 </div> 1222 1223 </div> 1224</div> 1225 1226 1227<A NAME="getTargetContext()"></A> 1228 1229<div class="jd-details api apilevel-"> 1230 <h4 class="jd-details-title"> 1231 <span class="normal"> 1232 public 1233 static 1234 1235 1236 1237 Context 1238 </span> 1239 <span class="sympad">getTargetContext</span> 1240 <span class="normal">()</span> 1241 </h4> 1242 <div class="api-level"> 1243 <div></div> 1244 1245 1246 1247 </div> 1248 <div class="jd-details-descr"> 1249 1250 1251 1252 1253 <div class="jd-tagdata jd-tagdescr"><p>Return a Context for the target application being instrumented. Use this to get a 1254 <code><a href="../../../../reference/android/content/Context.html">Context</a></code> representing <code><a href="../../../../reference/android/app/Instrumentation.html#getTargetContext()">getTargetContext()</a></code> into your test. 1255</p></div> 1256 1257 </div> 1258</div> 1259 1260 1261<A NAME="registerInstance(android.app.Instrumentation, android.os.Bundle)"></A> 1262 1263<div class="jd-details api apilevel-"> 1264 <h4 class="jd-details-title"> 1265 <span class="normal"> 1266 public 1267 static 1268 1269 1270 1271 void 1272 </span> 1273 <span class="sympad">registerInstance</span> 1274 <span class="normal">(Instrumentation instrumentation, Bundle arguments)</span> 1275 </h4> 1276 <div class="api-level"> 1277 <div></div> 1278 1279 1280 1281 </div> 1282 <div class="jd-details-descr"> 1283 1284 1285 1286 1287 <div class="jd-tagdata jd-tagdescr"><p>Records/exposes the instrumentation currently running and stores a copy of the 1288 instrumentation arguments Bundle in the registry. 1289 <p> 1290 This is a global registry - so be aware of the impact of calling this method! 1291 </p></p></div> 1292 <div class="jd-tagdata"> 1293 <h5 class="jd-tagtitle">Parameters</h5> 1294 <table class="jd-tagtable"> 1295 <tr> 1296 <th>instrumentation</td> 1297 <td>the instrumentation currently running.</td> 1298 </tr> 1299 <tr> 1300 <th>arguments</td> 1301 <td>the arguments for this application. Null deregisters any existing arguments. 1302</td> 1303 </tr> 1304 </table> 1305 </div> 1306 1307 </div> 1308</div> 1309 1310 1311 1312 1313 1314<!-- ========= METHOD DETAIL ======== --> 1315 1316 1317 1318<!-- ========= END OF CLASS DATA ========= --> 1319<A NAME="navbar_top"></A> 1320</div> <!-- jd-content --> 1321 1322<div class="wrap"> 1323 <div class="dac-footer"> 1324 <div class="cols dac-footer-main"> 1325 <div class="col-1of2"> 1326 <a class="dac-footer-getnews" data-modal-toggle="newsletter" href="javascript:;">Get news & tips <span 1327 class="dac-fab dac-primary"><i class="dac-sprite dac-mail"></i></span></a> 1328 </div> 1329 <div class="col-1of2 dac-footer-reachout"> 1330 <div class="dac-footer-contact"> 1331 <a class="dac-footer-contact-link" href="http://android-developers.blogspot.com/">Blog</a> 1332 <a class="dac-footer-contact-link" href="/support.html">Support</a> 1333 </div> 1334 <div class="dac-footer-social"> 1335 <a class="dac-fab dac-footer-social-link" href="https://www.youtube.com/user/androiddevelopers"><i class="dac-sprite dac-youtube"></i></a> 1336 <a class="dac-fab dac-footer-social-link" href="https://plus.google.com/+AndroidDevelopers"><i class="dac-sprite dac-gplus"></i></a> 1337 <a class="dac-fab dac-footer-social-link" href="https://twitter.com/AndroidDev"><i class="dac-sprite dac-twitter"></i></a> 1338 </div> 1339 </div> 1340 </div> 1341 1342 <hr class="dac-footer-separator"/> 1343 1344 1345 <p class="dac-footer-copyright"> 1346 1347 Except as noted, this content is licensed under <a 1348 href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>. 1349 For details and restrictions, see the <a href="../../../../license.html"> 1350 Content License</a>. 1351 </p> 1352 <p class="dac-footer-build"> 1353 1354 Android r — 1355<script src="../../../../timestamp.js" type="text/javascript"></script> 1356<script>document.write(BUILD_TIMESTAMP)</script> 1357 1358 </p> 1359 1360 1361 <p class="dac-footer-links"> 1362 <a href="/about/index.html">About Android</a> 1363 <a href="/auto/index.html">Auto</a> 1364 <a href="/tv/index.html">TV</a> 1365 <a href="/wear/index.html">Wear</a> 1366 <a href="/legal.html">Legal</a> 1367 1368 <span id="language" class="locales"> 1369 <select name="language" onchange="changeLangPref(this.value, true)"> 1370 <option value="en" selected="selected">English</option> 1371 <option value="es">Español</option> 1372 <option value="ja">日本語</option> 1373 <option value="ko">한국어</option> 1374 <option value="ru">Русский</option> 1375 <option value="zh-cn">中文(简体)</option> 1376 <option value="zh-tw">中文(繁體)</option> 1377 </select> 1378 </span> 1379 </p> 1380 </div> 1381</div> <!-- end footer --> 1382 1383<div data-modal="newsletter" data-newsletter data-swap class="dac-modal newsletter"> 1384 <div class="dac-modal-container"> 1385 <div class="dac-modal-window"> 1386 <header class="dac-modal-header"> 1387 <button class="dac-modal-header-close" data-modal-toggle><i class="dac-sprite dac-close"></i></button> 1388 <div class="dac-swap" data-swap-container> 1389 <section class="dac-swap-section dac-active dac-down"> 1390 <h2 class="norule dac-modal-header-title">Get the latest Android developer news and tips that will help you find success on Google Play.</h2> 1391 <p class="dac-modal-header-subtitle">* Required Fields</p> 1392 </section> 1393 <section class="dac-swap-section dac-up"> 1394 <h2 class="norule dac-modal-header-title">Hooray!</h2> 1395 </section> 1396 </div> 1397 </header> 1398 <div class="dac-swap" data-swap-container> 1399 <section class="dac-swap-section dac-active dac-left"> 1400 <form action="https://docs.google.com/forms/d/1QgnkzbEJIDu9lMEea0mxqWrXUJu0oBCLD7ar23V0Yys/formResponse" class="dac-form" method="post" target="dac-newsletter-iframe"> 1401 <section class="dac-modal-content"> 1402 <fieldset class="dac-form-fieldset"> 1403 <div class="cols"> 1404 <div class="col-1of2 newsletter-leftCol"> 1405 <div class="dac-form-input-group"> 1406 <label for="newsletter-full-name" class="dac-form-floatlabel">Full name</label> 1407 <input type="text" class="dac-form-input" name="entry.1357890476" id="newsletter-full-name" required> 1408 <span class="dac-form-required">*</span> 1409 </div> 1410 <div class="dac-form-input-group"> 1411 <label for="newsletter-email" class="dac-form-floatlabel">Email address</label> 1412 <input type="email" class="dac-form-input" name="entry.472100832" id="newsletter-email" required> 1413 <span class="dac-form-required">*</span> 1414 </div> 1415 </div> 1416 <div class="col-1of2 newsletter-rightCol"> 1417 <div class="dac-form-input-group"> 1418 <label for="newsletter-company" class="dac-form-floatlabel">Company / developer name</label> 1419 <input type="text" class="dac-form-input" name="entry.1664780309" id="newsletter-company"> 1420 </div> 1421 <div class="dac-form-input-group"> 1422 <label for="newsletter-play-store" class="dac-form-floatlabel">One of your Play Store app URLs</label> 1423 <input type="url" class="dac-form-input" name="entry.47013838" id="newsletter-play-store" required> 1424 <span class="dac-form-required">*</span> 1425 </div> 1426 </div> 1427 </div> 1428 </fieldset> 1429 <fieldset class="dac-form-fieldset"> 1430 <div class="cols"> 1431 <div class="col-1of2 newsletter-leftCol"> 1432 <legend class="dac-form-legend">Which best describes your business:<span class="dac-form-required">*</span> 1433 </legend> 1434 <div class="dac-form-radio-group"> 1435 <input type="radio" value="Apps" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-app" required> 1436 <label for="newsletter-business-type-app" class="dac-form-radio-button"></label> 1437 <label for="newsletter-business-type-app" class="dac-form-label">Apps</label> 1438 </div> 1439 <div class="dac-form-radio-group"> 1440 <input type="radio" value="Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-games" required> 1441 <label for="newsletter-business-type-games" class="dac-form-radio-button"></label> 1442 <label for="newsletter-business-type-games" class="dac-form-label">Games</label> 1443 </div> 1444 <div class="dac-form-radio-group"> 1445 <input type="radio" value="Apps and Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-appsgames" required> 1446 <label for="newsletter-business-type-appsgames" class="dac-form-radio-button"></label> 1447 <label for="newsletter-business-type-appsgames" class="dac-form-label">Apps & Games</label> 1448 </div> 1449 </div> 1450 <div class="col-1of2 newsletter-rightCol newsletter-checkboxes"> 1451 <div class="dac-form-radio-group"> 1452 <div class="dac-media"> 1453 <div class="dac-media-figure"> 1454 <input type="checkbox" class="dac-form-checkbox" name="entry.732309842" id="newsletter-add" required value="Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities."> 1455 <label for="newsletter-add" class="dac-form-checkbox-button"></label> 1456 </div> 1457 <div class="dac-media-body"> 1458 <label for="newsletter-add" class="dac-form-label dac-form-aside">Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.<span class="dac-form-required">*</span></label> 1459 </div> 1460 </div> 1461 </div> 1462 <div class="dac-form-radio-group"> 1463 <div class="dac-media"> 1464 <div class="dac-media-figure"> 1465 <input type="checkbox" class="dac-form-checkbox" name="entry.2045036090" id="newsletter-terms" required value="I acknowledge that the information provided in this form will be subject to Google's privacy policy (https://www.google.com/policies/privacy/)."> 1466 <label for="newsletter-terms" class="dac-form-checkbox-button"></label> 1467 </div> 1468 <div class="dac-media-body"> 1469 <label for="newsletter-terms" class="dac-form-label dac-form-aside">I acknowledge that the information provided in this form will be subject to <a href="https://www.google.com/policies/privacy/">Google's privacy policy</a>.<span class="dac-form-required">*</span></label> 1470 </div> 1471 </div> 1472 </div> 1473 </div> 1474 </div> 1475 </fieldset> 1476 </section> 1477 <footer class="dac-modal-footer"> 1478 <div class="cols"> 1479 <div class="col-2of5"> 1480 </div> 1481 </div> 1482 <button type="submit" value="Submit" class="dac-fab dac-primary dac-large dac-modal-action"><i class="dac-sprite dac-arrow-right"></i></button> 1483 </footer> 1484 </form> 1485 </section> 1486 <section class="dac-swap-section dac-right"> 1487 <div class="dac-modal-content"> 1488 <p class="newsletter-success-message"> 1489 You have successfully signed up for the latest Android developer news and tips. 1490 </p> 1491 </div> 1492 </section> 1493 </div> 1494 </div> 1495 </div> 1496</div> <!-- end footer --> 1497 1498</div><!-- end doc-content --> 1499 1500</div> <!-- end .cols --> 1501</div> <!-- end body-content --> 1502 1503 1504 1505 1506 1507 1508</body> 1509</html> 1510