I have been working on this all night and I am in a brain fog. can anyone give me a code snipit that would help I currently have this to populate SpinnerA onCreate:
ArrayAdapter<CharSequence> adapterTypeGas = ArrayAdapter.createFromResource(
this, R.array.TypeGas, android.R.layout.simple_spinner_item);
adapterTypeGas.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerTypeGas.setAdapter(adapterTypeGas);
R.array.TypeGas has two choices “Propane Gas” or “Natural Gas”. depending on what the user selects I want SpinnerB to use either R.array.NaturalGas or R.array.PropaneGas. My problem is that the spinner is populated at create how do I change it so it is not populated until after SpinnerA onItemSelected? Thanks for your help. I am fairly new to developing so if you could be detailed in your answer that would be great.
after implementing the code from “RastheDestoryer” i get an error at “createFromResource” of the ArrayAdapter for spinnerB. the error is: The method createFromResource(Context, int, int) in the type ArrayAdapter is not applicable for the arguments (CSSTPipeSizingActivity.OnGasSelectedListener, int, int). In my main.xml file I have to specify an array for spinnerB (that array is stored in my strings.xml file) uses. I think this is the problem, because in my code I am telling it a different array. Any thoughts on how to resolve this?
This is the code that I ended up using: