I\'ve been developing on Eclipse for years and have just started a new project on Android Studio.
I\'m noticing that every time I run a build, Android Studio
This is not default behavior. It does not happen in my Android Studio. Which Android studio are you using?
The only time when something like this should happen is when there are bugs in the project and Android STudio navigates to each bug (opens a file containing the bug). I cannot remember of any other.
Also, if you never before used Android Studio, then just double check if you maybe have some old .AndroidStudio
folder which contains settings data. Maybe in the past you installed some old version which has this feature turned on or you accidentally turned it on and these changes were now imported. I see no other logical explanation for this.
I think you want to use the "Project" view, and not the "Project Files" view. I had this problem when I first switched from Eclipse to Android Studio and found it was because I'd set the file browser (top left) to look at Project files and not Project. The normal Project view does much the same thing and doesn't collapse when running tests.