IDs for things like R.layout.simple_list_item_1
don't show up on autocompletion in Android Studio. Nor can they be resolved when the name is typed in manually. I'm trying to use an ArrayAdapter, and I had to manually create a simple_list_item_1.xml
in my project layout directory, and paste in the contents from the Android repository on Github
Am I missing something, or is that what's supposed to be done? Most resources I go to seem to just reference the list item XML without doing anything else
to use android predefined layouts, colors etc. You should use
android.R.layout.simple_list_item_1
probably you try to reach your own resources. Check your imports and you should see your R file.
as @Orhan Obut explained, use
android.R.layout.simple_list_item_1
.
Do NOT leave out the word android in the above statement. That is how you access android's predefined resources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With