[android] What does AdapterView<?> mean in the OnitemClick() Method? What is the use of other parameters in it?



Answers

The ? means that the datatype is unknown and it can be any type.

Question
gridview.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
        }
    });



Related