【发布时间】:2016-03-29 22:37:07
【问题描述】:
我正在导入源代码,并且在两个代码位置出现此错误:
错误:(86, 60) 错误:无法比较的类型:Object 和 int
if (selectedPhotos.containsKey(photoEntry.imageId)) {
selectedPhotos.remove(photoEntry.imageId);
v.setChecked(false, true);
photoEntry.imagePath = null;
photoEntry.thumbPath = null;
v.setPhotoEntry(photoEntry, v.getTag() == MediaController.allPhotosAlbumEntry.photos.size() - 1);
// ^-here-^
} else {
selectedPhotos.put(photoEntry.imageId, photoEntry);
v.setChecked(true, true);
还有这个:
if (passwordFrameLayout.getTag() != 0) {
// ^Here
t = (Integer) passwordFrameLayout.getTag();
}
我应该对这些进行哪些更改?
我在 Stack 中进行了搜索,但无法修复它们。我是这方面的新手,请帮忙。
顺便说一句,我正在使用 Android Studio Last Version!
我正在开发主要的Telegram source,没有任何变化。
并获取标签功能:
@ViewDebug.ExportedProperty
public Object getTag() {
return mTag;
}
在android-23/android/view/View.java中
【问题讨论】:
-
getTag()的类型是什么?显然不是整数。 -
@Eran 编辑并添加。
-
好吧,知道它是一个对象并没有多大帮助。它返回的实际(特定)类型是什么?
-
@Eran 输出类型为
FrameLayout passwordFrameLayout -
那你为什么要把它和一个数字比较呢?你期望发生什么?
标签: java android android-studio telegram