I have a list of clients. I would like when I clicked on a client it would open a new intent. But I did something wrong. Here are the codes:
list.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(ClienteActivity.this, DetalhesCatalogo.class);
startActivity(intent);
}
});
}
When squeezing it it gives the following error:
09-16 13:13:25.047 1532-1532/com.example.jnior.decorus E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jnior.decorus, PID: 1532
*java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxxxxxxxxxxxxxxxxxxxxxx.ClienteActivity}:
java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead*