什么是迁移的Andr​​oid code? [英] What is Migrate Android Code?

查看:140
本文介绍了什么是迁移的Andr​​oid code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为ADT 14,资源字段不能被用作开关  案例。调用此修复程序,以获取更多信息。请告诉我这个原因是干什么用的?

As of ADT 14, resource fields cannot be used as switch cases. Invoke this fix to get more information. whats the reason this is used for?

推荐答案

看看这个官方博客文章:

Take a look at the official blog post about this:

<一个href="http://tools.android.com/recent/switchstatementconversion">http://tools.android.com/recent/switchstatementconversion

<一个href="http://tools.android.com/tips/non-constant-fields">http://tools.android.com/tips/non-constant-fields

基本上,在库项目资源常量不再是最后。从ADT网站:

Basically, resource constants in library projects are no longer "final". From the ADT Site:

在换句话说,常量不是最终的库项目。该   原因很简单:当多个库项目   结合时,字段的实际值(必须是唯一的)可以   碰撞。 ADT 14之前,所有字段都最终,所以作为结果,所有的   库必须有他们所有的资源和相关的Java code   只要与他们所用的主要项目重新编译沿。本   是坏的性能,因为它使建立非常缓慢。它也是   prevented分发库项目,不包括源   code,限制了库项目的使用范围。

In other words, the constants are not final in a library project. The reason for this is simple: When multiple library projects are combined, the actual values of the fields (which must be unique) could collide. Before ADT 14, all fields were final, so as a result, all libraries had to have all their resources and associated Java code recompiled along with the main project whenever they were used. This was bad for performance, since it made builds very slow. It also prevented distributing library projects that didn't include the source code, limiting the usage scope of library projects.

这篇关于什么是迁移的Andr​​oid code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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