I've been trying to solve a problem which i been having for past week , i am trying to a access spinner inside different xml layout, all i want is to access the spinner and add array to the spinner.
This is the code i am using and it doesn't work
setContentView(R.layout.mainreg);
LinearLayout mainLayout = (LinearLayout)findViewById(R.id.main_layout_id);
View view123 = getLayoutInflater().inflate(R.layout.one2reg, mainLayout,false);
Spinner spin = (Spinner) view123.findViewById(R.id.spinnerproblem);
ArrayAdapter<String> adapter =
new ArrayAdapter<String> (this, android.R.layout.simple_spinner_item,items);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spin.setAdapter(adapter);
mainLayout.addView(view123);