Where is the source code that controls reuse Viewin Android? I can think of three different parts of this process, but maybe more:
- The logic that determines whether
Viewto reuse - Code that manages pools
Viewthat can be reused - Code that removes reusable
Viewfrom the pool and resets its property values to represent logically differentView
EDIT: Android App Development Blog post - gotchas and quirks give the following example:
public class PencilWise extends ListActivity {
View activeElement;
@Override
public void onCreate ( Bundle savedInstanceState ) {
this.getListView( ).setOnItemClickListener ( new OnItemClickListener ( ) {
public void onItemClick ( AdapterView<?> parent, View view, int position, long id ) {
MyActivity.this.activeElement = view;
MyActivity.this.showDialog ( DIALOG_ANSWER );
}
} );
}
}
showDialog , , . , , onItemClick, , activeElement , , !