Reputation: 5352
Performance wise, is it the same to place an onclick listener in a getView() call of an adapter or place the onclick listener outside on a listview that contains the adapter?
My underlying thought is to reduce code if I use the same adapter in two different places. But I need to make sure the performance wouldn't be affected!
Upvotes: 1
Views: 440
Reputation: 6821
The performance difference would be so negligible, I wouldn't even worry about it. Instead opting for whatever seems to be fit for your design approach. If you want to reduce code duplication, putting it in the getView()
works just fine.
Upvotes: 1