InfernumDeus
InfernumDeus

Reputation: 1202

How to get/set text value of AutoCompleteTextView in Xamarin?

This problem looks trivial but I can't find solution for Xamarin.

Upvotes: 0

Views: 374

Answers (1)

Timo Salomäki
Timo Salomäki

Reputation: 7189

AutoCompleteTextView extends the EditText class so you should be able to get and set the text just by playing around with the Text property like this:

var autocompleteTextView = FindViewById<AutoCompleteTextView>(Resource.Id.AutoCompleteInput);
string currentText = autocompleteTextView.Text;
autocompleteTextView.Text = "New text";

Upvotes: 2

Related Questions