Android Studio Navigation Error - New Windows in Background - android-studio

I am having a weird error with Android Studio. When I am navigating through the software, new windows tend to appear in the background rather than the foreground. This inconvenience is making it extremely difficult to navigate. Any ideas what setting is causing this? In some instances, it is preventing me from progressing.
I have included a screenshot of the issue. You can see that my "Browse Repositories" is behind the "Plugins." In cases where the new dialog window is smaller than the original, I am unable to proceed (since I can't even see the new dialog).

A workaround is to avoid maximizing the screen. Reports have been sent via the official Google Android forums, so we will see if a fix is implemented.

Related

Window.onblur or Window.onfocus not working in Android Studio

I implemented a simple Javascript function, which allows the audio to be paused or start depending on if the window where the script runs is focused on or not, and it works on the web.
However, I noticed an issue when I try to implement it in android studio, even after enabling the JS as seen in the screenshot. Indeed, when I get out of the app, the sound is still running whether I click on the back or the home button.
I'd like to add as well that I'm a total beginner in the android studio IDE, but I wanted to know if I could maybe find an answer here. How to make my Javascript-script work in the android environment ?
Thanks in advance
Audio Initialization
Javascript function for window.onblur and window.onfocus
Enabled Javascript in MainActivity.Java

Can't seem to find DDMS in Android Studio 2.1.2

Not sure what I'm doing wrong here.
My basic goal is that I'd like to be able to take screenshots of my Android tablet via Android Studio which is running on my Windows laptop.
I gather I need Dalvik Debug Monitor Server (DDMS) to do this, however I'm struggling to find it within Android Studio.
All the guides I've read so far mention that you simply click on the DDMS menu button in the toolbar. This seems to appear like a green android robot.
Well, I have the android robot and so I click on that. The tooltip for the button says 'Android Device Monitor', nothing to do with DDMS.
And then normally says 'Android Monitor is already running' and does nothing. But all I have on my screen is Logcat and Monitors tab. I can't see the same stuff that I usually see on DDMS screenshots.
Occasionally it will throw an error which appears in the log files (but too big to post here)
How can I fix this?
Ok, officially dumb.
The DDMS was opening up in the background of another monitor.
Carry on...

No "Android DDMS" in Tools->Android menu?

In IDEA I can open DDMS from inside it via Tools->Android menu. However in Androdi Studio there is no such entry.
How can I open DDMS from Android Studio? Is this feature ported from IDEA to Android Studio?
DDMS is apparently still there, in sdk/tools/ddms (can be started from terminal).
Tools>Android>Android Device Monitor apparently contains a DDMS.
They look different, but the latter seems to have at least everything provided by the former, which seems to lack a File Explorer? Presumably the former is a fall-back until the latter is completely stable?
Disclaimer: just starting to explore this.

Visual Studio regularly freezes running Microsoft.VisualStudio.Web.Host.exe

Background
I maintain several web sites that are Visual Studio "Web Site Projects".
Problem
I've found that with a couple of these projects, Visual Studio regularly freezes while I'm working on the code. This doesn't happen for some of the web site projects, and I haven't seen it happen on any Web Application projects.
Symptoms
Each time it freezes, it takes about half a minute before I can use it again.
During a freeze, Windows Task Manager reports that Microsoft.VisualStudio.Web.Host.exe is maxing out one of the CPU cores.
Steps to Reproduce
Open a .cs file under the App_Code directory.
Make a change to the file.
Save the file.
Navigate somewhere else (eg switch tab, close the file, open different program in Windows).
Navigate back to the file (eg switch tab to it, open it, or go back to Visual Studio).
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring
"Find usages"
What I've Tried
Both Visual Studio 2012 and Visual Studio 2015
Changing the website project's build action
Disabling "Build Web site as part of solution"
Deleting web references and the Bin folder seems to minimise the problem, but obviously this breaks the web site. Maybe web site projects experience this problem when they contain a lot of C# code other than code-behind files?
Similar problems
I found the following potentially-related problems using Google, but none of them seemed to contain a workaround or solution.
Microsoft.VisualStudio.Web.Host.exe Time Theft
Microsoft.VisualStudio.Web.Host.exe
Visual Studio 2012 freezes for approximately 30 seconds after every build
I noticed that the problem happened less often when I suspended ReSharper.
The problem still happened occasionally when editing classes under App_Code, but restarting Visual Studio worked around it.
I was facing a similar problem. A single Web application project with dozens of class libraries, migrated over from VS 2010 into VS 2013.
I was able to solve my problem by disabling the "Hosting Process" option:
To disable the hosting process
Open an executable project in Visual Studio. Projects that do not
produce executables (for example, class library or service projects)
do not have this option.
On the Project menu, click Properties.
Click the Debug tab.
Clear the Enable the Visual Studio hosting process check box.
Full details on MSDN: http://msdn.microsoft.com/en-us/library/ms185330.aspx
Another option for people experiencing this on old web applications that don't have the properties page in the accepted answer above.
Disable "Allow this precompiled site to be updatable".
Open Site/Solution
Right click and view Property Pages
Go to MSBuild Options
Uncheck "Allow this precompiled site to be updatable"
This worked for me.
This problem stopped happening when the Web Site project was converted into a Web Application project.
Not an easy solution, but it did stop the problem.
They symptoms in the question of this post sound exactly like the nightmares I just had today:
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring "Find usages"
Plus intellisense wasn't working (even with CTRL + J) and
'Peek definition' was hanging as well.
I had to keep task killing visual studio (both 2015 and 2017).
My fix was to go into the project that I was having problems with, open the 'Package Manager Console' and uninstall and re-install the 'DotNetCompilerPlatform'
uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
and then
install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
So far every problem I was encountering has not resurfaced (but this was just today so still need to give it time).
UPDATE:
It started creeping back again. I noticed also that whomever had installed to the solution had only done it to two of the various projects. Uninstalling the compiler platform (which means using the compilers that came with Visual Studio) has made life sane again.

Android Studio Preview

I just opened a new project in Android Studio, but the preview screen isn’t working. It should show “Hello World!” right now, but it’s blank. When I go to other projects I’ve completed, the preview doesn’t show up there either.
I’ve reinstalled the program and I’m googling ways to fix the problem. If anyone has had this problem and fixed it, or just has an idea of what to do, I’d greatly appreciate the help! I will attach a screenshot of my Android Studio. Android Studio w/ preview problem
Thanks
Have you checked your preview window in android studio ?
I am asking to you because I was also in the same problem a month ago.
If yes, In The Preview Window. There Will Be A Error Symbol On that window.
Tap on that it will show you the reason for preview error. Fix it and now it works perfectly in my pc.
Edit 1:
Exact Solution after your comment
Tap On That Blue Dot
It would tell preview fidelity issue for the session. Mute The Fidelity Issue For The Session From Same Window And You Are Good To Go.

Resources