Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio hangs when drag/dropping UI element

I installed Android Studio 1.0 and have JDK 1.8.

I make New Project, use a 'blank activity with fragment' and set the minimum version to lollipop (5.0)

Then I go to fragment_main.xml and drag an UI element to the phone (in the example i used a button)

The moment the drag interface is visible on the phone, android studio hangs and i'm unable to do anything expect killing the process with windows taskmanager.

enter image description here

My mouse looks like this:

enter image description here

Any ideas? Thanks.

like image 993
Jonathan V Avatar asked Dec 11 '14 19:12

Jonathan V


People also ask

Does Android studio support drag and drop?

The Android drag and drop framework enables you to add interactive drag and drop capabilities to your app. With drag and drop, users can copy or move text, images, objects—any content that can be represented by a URI—from one View to another within an app or, in multi-window mode, between apps.

What is Jank in Android?

Android renders UI by generating a frame from your app and displaying it on the screen. If your app suffers from slow UI rendering, then the system is forced to skip frames. When this happens, the user perceives a recurring flicker on their screen, which is referred to as jank.


1 Answers

I may have found a solution for this.

I was having the same exact issue and couldn't figure out what was going on for the life of me until:

I theorized that perhaps it was just the windows display that was frozen (the visual rendering of the Android Studio program itself) and guessed that perhaps this was using a DirectX device to do the rendering of the Android UI.

I happen to have another app running on my computer that uses a DirectX device for rendering (SimpleJungleTimer, an app I programmed with a DirectX overlay for League of Legends jungle timers). After I shut down this app Android Studio appears to be working properly (not freezing when working with the UI anymore)

Ultimately it sounds like this is a bug with Android Studio itself where they don't properly kill / reload the DirectX rendering device when it is in conflict with another app's active DirectX device (something that the android studio developers should probably fix), however until the android studio developers fix this you should be able to get around this bug by making sure any other applications that might use DirectX for rendering are shut down while coding in Android Studio so that their DirectX rendering devices don't conflict with Android Studio's DirectX device.

like image 142
wootowl Avatar answered Sep 29 '22 11:09

wootowl