简体   繁体   中英

Android 2 instant run

Per Android Studio instant run documentation

Code Change

  • Change implementation code of an existing instance method or static method

Instant Run Behavior

  • Supported with hot swap: This is the fastest type of swap and makes changes visible almost instantly. Your application keeps running and
    a stub method with the new implementation is used the next time the
    method is called.

However, whenever I do make changes to instance methods or static ones there is always an app restart. Any solution?

Are you sure that you are seeing an app restart and not an activity restart? By default, activity restart is turned on even for hot swappable changes. You can change this behavior by going to Settings (or Preferences) > Build, Execution, Deployment > Instant Run, and uncheck "Restart activity on code changes".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM