我正在开发一个基于Eclipse的旧项目,并在Android Studio中打开它。最初使用1.7版本构建,现在我已经在1.8版本上,尝试1.7但没有成功。在迁移到Android Studio时投射
我的主要问题是,我得到了3个以下错误:
float size = (float) Float.parseFloat(v.getTag(R.string.size));
Error:
Error: Error:(228, 71) java: incompatible types: java.lang.Object cannot be converted to java.lang.String
代码: INT POS =(INT)v.getTag(R.string.pos);
Error: Error:(229, 49) java: incompatible types: java.lang.Object cannot be converted to int
Code:
int parentpos = (int) v.getTag(R.string.parentpos);
Error:
Error: Error:(234, 63) java: incompatible types: java.lang.Object cannot be converted to int
我知道它正试图将对象转换为整数。我尝试了几种可能的解决方案,但没有运气。代码中的任何可能的变化,我不明白的事情?
谢谢!
的第一个和第三个解决,但第二个不是。我不知道是否有什么不对,但不应该,因为这个应用程序是大约两年前由我和一个朋友开发的,当时似乎没有问题。 –
但第二个等于第三个。它不会发送,是吗? – Blackbelt