我试图在我的应用程序中从微调器中选择项目时隐藏或显示编辑文本。这里是代码,请建议如何修复它
ArrayAdapter adapter1 = ArrayAdapter.createFromResource(
this, R.array.country_array, android.R.layout.simple_spinner_item);
adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(adapter1);
spinner1.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
rlDate.setVisibility(View.VISIBLE);
rlTime.setVisibility(View.VISIBLE);
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
}
});