Where is the code that controls the reuse view in Android?

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 , , !

+3
2

, , , AbsListView.RecycleBin, widget.
: https://android.googlesource.com/platform/frameworks/base/+/android-2.2_r1.1/core/java/android/widget/AbsListView.java#3888

:

RecycleBin . RecycleBin   : ActiveViews ScrapViews. ActiveView - ,    . .   , ActiveViews ScrapViews. ScrapViews - ,    , .

+1
+3

Source: https://habr.com/ru/post/1788820/


All Articles