Currently, when the ListItem is clicked I grab its position and pass it to my StopsScheduleActiviy. I would like to detect when the ImageView of that ListItem is clicked so that I can launch my MapActivity instead and pass it the position.
Basically: Click the ImageView launch MapsActivity, otherwise click anywhere else on ListItem launch StopsScheduleActivity. In Both cases I need the position. How can I do this?
Here is my current onItemClick listener.
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent myIntent = new Intent(this, StopsScheduleActivity.class);
myIntent.putExtra("stop", stops.get(position));
startActivity(myIntent);
Log.i("Winnipeg Bus", "Stop item #" + id + " clicked.");
}
Here is my ListView with a map for an ImageView that I want to listen to for clicks. Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…