Answers for "how to add data to spinner in android"

2

get data from spinner android studio

Spinner spinner_house = (Spinner) findViewById(R.id.spinner_house);
String spinner_house_data = spinner_house.getSelectedItem().toString();
Posted by: Guest on February-10-2021
1

how to set list data to android spinner

// setting branch data in manually and load to spBranchName
        List<String> branchList = new ArrayList<>();
        branchList.add("CHITTAGONG");
        branchList.add("DHAKA");

        ArrayAdapter<String> branchListAdapter = new ArrayAdapter<>(getActivity(),
                android.R.layout.simple_spinner_item, branchList);
        branchListAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spBranchName.setAdapter(branchListAdapter);
Posted by: Guest on November-14-2020

Code answers related to "how to add data to spinner in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language