I am selecting text for AutoCompleteTextView.After i want apply setonclicklistener to selected text.if any have idea.
ArrayAdapter<String> arrAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, sampleACTV);
AutoCompleteTextView ACTV = (AutoCompleteTextView) findViewById(R.id.spinner);
ACTV.setAdapter(arrAdapter);
}
private static final String[] sampleACTV = new String[]
{ "android","androidpeople.com","iphone","blackberry" };
in my example i am selecting one like android
call an intent to go to nest Acitivity
There are different click listeners in AutoCompleteTextView.
The first way is in the layout xml, you can define the onCLick attribute, with the function that you want to be called, in the example below, clicked.
Then, in your activity, you define the function clicked.
Or you can set it directly in your code:
If you want to set the click listener when the user clicks in an item in the dropdown list there is another method, the setOnItemClickListener.
And you have a last option, to set the click listener when the user actually selects an item in the dropdown list using setOnItemSelectedListener.
References:
http://developer.android.com/reference/android/widget/AutoCompleteTextView.html
Good luck!
You need to create Custom Adapter and assign OnClick event to the view in getView()