[英]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.