I want to use Spinner in my application. Spinner context (elements) depends on user settings made in the application settings.
I created Spinner without elements. After downloading the application, Spinner has one entry. To get entries, the user must go to the menu and upload the image. Based on this, the elements are loaded into a String Array. This array of strings will be passed to the adapter. See Code:
List<String> als = new ArrayList<String>(); als = Arrays.asList(Data.getfloornames()); adapter = new ArrayAdapter<String>(this, R.array.flooritem, als); adapter.notifyDataSetChanged(); floornum.setAdapter(adapter);
After that. The user will be returned to the settings menu. Clicking on the menu Sets the back button on devices, cancels the application.
Error from Logcat is FATAL Exception: main. 05-16 15:12:43.193: E/AndroidRuntime(9128): android.content.res.Resources$NotFoundException: Resource ID
What am I doing wrong? Is it impossible to set Spinner elements in the application menu settings?
source share