I am fetching the values from Database using JSON and inserting them into spinner. This process is running successfully. But I am receiving a Spinner hint two times, when I cli
Use the ArrayAdapter and Override the method - getDropDownView..
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, lables){
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
View v = null;
if (position == 0) {
TextView tv = new TextView(getContext());
tv.setHeight(0);
tv.setVisibility(View.GONE);
v = tv;
}
else {
v = super.getDropDownView(position, null, parent);
}
parent.setVerticalScrollBarEnabled(false);
return v;
}
};
Use the above mentioned code and remove the default value in the dropdown.