I am searching a way to do this :
public class SimpleText_SpinnerAdapter extends ArrayAdapter<Enum1> {
many lines of code with a one moment : String val = oneEnum1val_inparam.getlabel();
}
public class SimpleText_SpinnerAdapter extends ArrayAdapter<Enum2> {
exactly the same code than previously, but for Enum2
}
public class SimpleText_SpinnerAdapter extends ArrayAdapter<Enum3> {
exactly the same code than previously, but for Enum3
}
This is made to have 3 adapters for 3 spinners, that contains values from 3 differents Enums constructed exactly the same way but with different values.
Of course, each enum type has a getLabel() method.
I’d like to find a way to do this without needing to copy-paste 3 times the same code for each adapter. A sort of generic one, that could be referenced by 3 specialized one.
I don’t find the solution.
Could you help me to do this ?
Or if you have somthing more efficient…
Oliver
How about:
Instantiate class with (nm the constructor):