You can use the following code to select the data on your spinner.
if(state != null) {
for (int j = 0; j <= stateSpinner.getCount(); j++) {
if (stateSpinner.getItemAtPosition(j).equals(state)) {
stateSpinner.setSelection(j);
break;
}
}
}
Here,
stateSpinner is the variable name for spinner and state is the fetched data from Firebase.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…