Mojo Jojo
Mojo Jojo

Reputation: 173

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

my code showing this error...AdapterView is a raw type. References to generic type AdapterView should be parameterized for the AdapterView, what should i do?

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();
}

Upvotes: 1

Views: 993

Answers (1)

nKn
nKn

Reputation: 13761

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.

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.

Upvotes: 4

Related Questions