2012-07-27 79 views

回答

0

你可以做到这一点通过保存最后一个视图中的变量

View lastView = null; 
// ..... 
gv.setOnItemClickListener(new OnItemClickListener() { 

    @Override 
    public void onItemClick(AdapterView<?> arg0, View view, 
      int position, long arg3) { 
     if(lastView != null) { 
      // do something with the last view 
     } 

     // the rest of your code 

     lastView = view; 
    } 

}); 

未经测试,但应该工作。

+0

我也试过这个,但没有工作。 – 2012-07-27 07:29:20

+0

当你尝试时会发生什么? logcat – 2012-07-27 07:32:14

+0

中出现任何特定错误,原始项目(Imageview)中没有任何更改。第二个imageview创建,然后发生变化。 – 2012-07-27 09:21:45

相关问题