简体   繁体   English

AdapterView是原始类型。 泛型类型AdapterView的引用 <T> 应该参数化

[英]AdapterView is a raw type. References to generic type AdapterView<T> should be parameterized

my code showing this error...AdapterView is a raw type. 我的代码显示此错误... AdapterView是原始类型。 References to generic type AdapterView should be parameterized for the AdapterView, what should i do? 应该为AdapterView设置对泛型类型AdapterView的引用,我该怎么办?

public void onItemClick(AdapterView adapterview, View view, int i, long l) //*AdapterView is a raw type. References to generic type AdapterView<T> should be parameterized 
{
    ((ImageView)b.findViewById(0x7f090000)).setImageResource(a.getResources().obtainTypedArray(0x7f050000).getResourceId(i, -1));
    ((Button)b.findViewById(0x7f090002)).setOnClickListener(new c(this, b));
    ((Button)b.findViewById(0x7f090003)).setOnClickListener(new d(this, i));
    String s = a.getIntent().getAction();
    if ("android.intent.action.GET_CONTENT".equals(s) || "android.intent.action.PICK".equals(s))
    {
        ((Button)b.findViewById(0x7f090004)).setOnClickListener(new e(this, i, b));
    }
    b.show();
}

This is because this AdapterView is probably parametrized, which means that in its implementation the type is not forced, for example, to String or whatever else, but it's defined by the user. 这是因为此AdapterView可能已参数化,这意味着在其实现中不会强制将类型强制为String或其他类型,而是由用户定义。

So basically what the warning (not error) is telling you that instead of AdapterView adapterview you have to set it to AdapterView<YourType> adapterview (so you'd need to put here the type you've defined the AdapterView in the declaration. 所以基本上,警告(不是错误)告诉您,必须将其设置为AdapterView<YourType> adapterview (而不是AdapterView adapterview AdapterView<YourType> adapterview (因此,您需要在声明中放入定义AdapterView的类型。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型类是原始类型。 对泛型类型Class的引用 <T> 应该参数化 - Type Class is a raw type. References to generic type Class<T> should be parameterized 原始类型。 对泛型类型的引用应该被参数化 - Raw type. References to generic types should be parameterized 为什么我收到警告:Class是原始类型。对泛型类型<T>的引用应该参数化“? - Why am I getting the warning :Class is a raw type. References to generic type Class<T> should be parameterized"? 如何在Eclipse中禁用警告 - 'Class是原始类型。对泛型类型<T>的引用应该参数化' - How to disable warning in Eclipse - 'Class is a raw type. References to generic type Class<T> should be parameterized' Eclipse警告 - 类是原始类型。 对泛型类的引用 <T> 应该参数化 - Eclipse warning - Class is a raw type. References to generic type Class<T> should be parameterized AddLinkEntry类是原始类型。 对泛型类型AddLinkEntry类的引用 <T> 应该参数化 - AddLinkEntry Class is a raw type. References to generic type AddLinkEntry Class<T> should be parameterized 可比是原始类型。 对通用类型Comparable的引用 <T> 应该参数化 - Comparable is a raw type. References to generic type Comparable<T> should be parameterized 警告-类是原始类型。 对泛型类型Class的引用 <T> 应该参数化 - Warning - Class is a raw type. References to generic type Class<T> should be parameterized 类是原始类型。 对泛型类型Class的引用 <T> 应该参数化 - Class is a raw type. References to generic type Class<T> should be parameterized 枚举是原始类型。 对泛型类型 Enum 的引用<E>应该参数化 - Enum is a raw type. References to generic type Enum<E> should be parameterized
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM