我有两个微调器,其中第一个微调器使用自动完成文本视图,当以常规方式选择第一个微调器而不使用自动完成文本视图时,第二个微调器根据第一个微调器选择加载相应的值。我的问题是,当使用自动完成文本视图选择第一个微调器值时,第二个微调器不会根据第一个微调器选择加载值。谁能告诉我解决方法
public void vesselspinnerHandler(){
//Setting Class to Spinner
final ArrayAdapter<String> vesselspinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, vessellist);
vesselspinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
vesselspinner.setAdapter(vesselspinnerAdapter);
vesselspinnerAdapter.notifyDataSetChanged();
final AutoCompleteTextView searchvessel=findViewById(R.id.searchvessel);
final AutoCompleteTextView selves = findViewById(R.id.selectedvessel);
ArrayAdapter adapter1 = new ArrayAdapter(selection.this,android.R.layout.simple_spinner_dropdown_item,vessellist);
selves.setAdapter(adapter1);
selves.setDropDownVerticalOffset(50);
vesselspinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
selves.setText(vesselspinner.getSelectedItem().toString());
searchvessel.setText(selves.getText().toString());
getdate();//second spinner call
return;
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}