-3
值未顯示在微調器中 當點擊微調器時,我獲取了值,下拉列表中顯示了值。 但不是當我選擇微調微調器中未顯示數值Android
vechType_spinner.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3)
{
if (position != 0)
{
Toast.makeText(CreateItinerary.this, "testing vehicle", Toast.LENGTH_LONG).show();
selectedVehicalType = vechiclelist.get(position);
if (selectedVehicalType.contains("Car") || selectedVehicalType.contains("Motor Cycle") || selectedVehicalType.contains("Bike"))
{
expectedKM.setVisibility(View.VISIBLE);
//classSpinner.setVisibility(View.GONE);
}
else
{
expectedKM.setVisibility(View.GONE);
}
}
else
{
Toast.makeText(CreateItinerary.this, "testing else vehicle", Toast.LENGTH_LONG).show();
expectedKM.setVisibility(View.GONE);
//classSpinner.setVisibility(View.GONE);
}
}
@Override
public void onNothingSelected(AdapterView<?> arg0)
{
Toast.makeText(CreateItinerary.this, "testing NOthing selected vehicle", Toast.LENGTH_LONG).show();
}
});
onItemSelected是沒有得到調用。 雖然項目得到下拉? 是由於XML重疊?