N
N
Neonoviiwolf2017-06-24 01:16:30
Java
Neonoviiwolf, 2017-06-24 01:16:30

Explain how this Java code from androil SDK works and GC question?

Good
, I want to add something to the AutoCompleteTextView method, but I don’t understand how it works

@Override
    public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
        super.setAdapter(adapter);
    }

T-?
another question about GC, if something refers to an object, then it is clear that it will not collect, but if the object itself has a link to a singleton, will it collect it?
here is an example
public WorkAutoCompleteTextView(AutoCompleteTextView textView,
                                    Context context) {
        test.add(textView);
        completeTextView = textView;
        this.context = context;
        arrayAdapter = new ArrayAdapter(this.context,
                android.R.layout.simple_dropdown_item_1line,
                GetSQLCursorProductName.getInstance().listName);
        completeTextView.setAdapter(arrayAdapter);
    }

AutoCompleteTextView I write the adapter, and the list, will it be collected or is a copy of the list created here?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question