I am currently using an array adapter. All the examples that I came across online use a separate layout for the array adapter. I wanted to know if it had a default layout. My code is something like this
ArrayAdapter<String> adapt = new ArrayAdapter<String>(this,,item);
What should the second parameter so that I dont specify a resource layout and it uses its default ?
Here is the difference: BaseAdapter is a very generic adapter that allows you to do pretty much whatever you want. However, you have to do a bit more coding yourself to get it working. ArrayAdapter is a more complete implementation that works well for data in arrays or ArrayList s.
The Constraint layout is the default layout used in Android.
You can use the defalut one TextView
row item:
android.R.layout.simple_list_item_1
like so:
ArrayAdapter<String> adapt = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items)
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