拖放 UI 元素时 Android Studio 挂起 [英] Android Studio hangs when drag/dropping UI element

查看:20
本文介绍了拖放 UI 元素时 Android Studio 挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Android Studio 1.0 和 JDK 1.8.

I installed Android Studio 1.0 and have JDK 1.8.

我创建新项目,使用带片段的空白活动"并将最低版本设置为棒棒糖 (5.0)

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

然后我转到 fragment_main.xml 并将一个 UI 元素拖到手机上(在示例中我使用了一个按钮)

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

在手机上可以看到拖动界面的那一刻,android studio 挂起,除了使用 Windows 任务管理器终止进程之外,我无法做任何事情.

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.

我的鼠标看起来像这样:

My mouse looks like this:

有什么想法吗?谢谢.

推荐答案

我可能已经找到了解决方案.

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:

我推测可能只是窗口显示被冻结了(Android Studio 程序本身的视觉渲染),并猜测这可能是使用 DirectX 设备来渲染 Android UI.

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.

我碰巧在我的计算机上运行了另一个应用程序,它使用 DirectX 设备进行渲染(SimpleJungleTimer,我使用 DirectX 覆盖层为英雄联盟丛林计时器编程的应用程序).在我关闭此应用程序后,Android Studio 似乎运行正常(不再在使用 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)

最终,这听起来像是 Android Studio 本身的一个错误,当 DirectX 渲染设备与另一个应用程序的活动 DirectX 设备发生冲突时,它们无法正确终止/重新加载 DirectX 渲染设备(Android Studio 开发人员可能应该修复此问题),但是,在 android studio 开发人员解决此问题之前,您应该能够通过确保在 Android Studio 中编码时关闭可能使用 DirectX 进行渲染的任何其他应用程序来解决此错误,以便它们的 DirectX 渲染设备与 Android Studio 的 DirectX 设备不冲突.

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.

这篇关于拖放 UI 元素时 Android Studio 挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆