What is the fundamental difference between declaring
String foo[];
and
String[] foo;
Ex: I am using a spinner and the first example works while the second example doesn't, even though I don't have any other problems in the rest of my code using the second declaration method.
@Override
public void onClick(View view) {
String[] Condicoes = {fase, comunicacao,tipo_comunicacao};
String concat = "";
for (int k = 0; k < Condicoes.length; k++) {
String newfer[] = StringMapper.get(Condicoes[k]);
for(int i = 0; i<newfer.length; i++) {
//ArrayAdapter<String> spinningspinenER = new ArrayAdapter<String>(InsertID.this, android.R.layout.simple_spinner_item, newfer);
concat += newfer[i];
concat += "\n";
}
}
textView.setText(concat);
}
This is the code that gives me an error if I use:
String[] newfer = StringMapper.get(Condicoes[k]);
in the commented part
ArrayAdapter<String> spinningspinenER = new ArrayAdapter<String>(InsertID.this, android.R.layout.simple_spinner_item, newfer);
it says that it can not build the ArrayAdapter