I have the following code
Using java Syntax Highlighting
- imageView.setImageResource(mThumbIds[position]);
- imageView.setOnClickListener(new OnClickListener(){
- @Override
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- try{
- Intent myIntent = new Intent();
- Log.i("id clicked value", imageView.getId()+"");
- myIntent.putExtra("picID", imageView.getId());
- }catch(Exception e){
- e.printStackTrace();
- }
- }
- });
- return imageView;
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Basically I am initializing a new Image view based on a condition and then attaching an onClickListener for each view. But the getId() returning a -1 everytime. Why so?

