I have this code to control the dropdown array list in a Fragment using Kotlin.
How can I add icons in each item list programmatically (as shown in the picture).
Can someone please help me if this is possible. Thanks!
super.onViewCreated(view, savedInstanceState)
binding.foodField.setAdapter(
ArrayAdapter(
requireContext(),
android.R.layout.simple_spinner_dropdown_item,
resources.getStringArray(R.array.food),
Here is the array:
<string-array name="food">
<item>Pizza</item>
<item>Bread</item>
</string-array>
1