While working my way through the Android tutorials, I came across something I don't understand. It's probably extremely simple, but I just need an idea why it's this way.
In the tutorial: http://developer.android.com/resources/tutorials/views/hello-autocomplete.html
The tutorial seems to construct a new AutoCompleteTextView using:
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);
I assume their using the constructor:
AutoCompleteTextView(Context context, AttributeSet attrs)
I think their AttributeSet is the "findViewById(R.id.autocomplete_country)
"; while their context is the (AutoCompleteTextView)
. Is this right?
Also... where's the new keyword, the comma, and why is there a pair of parenthesis?
I always thought it'd have to be:
AutoCompleteTextView textview = new AutoCompleteTextView(context here, attrs here);
Where am I going wrong?!