How can create listView via simpleCursorAdapter
See original GitHub issueDBFlow Version: 3.0.0-beta6 Issue Kind (Question): How can create list view with SimpleCursorAdapter ? Following is my code but i get the fatal error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.saraylu.khayyatan/com.example.saraylu.khayyatan.CustomerListActivity}: java.lang.IllegalArgumentException: column ‘_id’ does not exist
FlowCursorList<Customer> cursor = new FlowCursorList<>SQLite.select().from(Customer.class));
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.customer_list,
cursor.getCursor(),
new String[]{"name", "mobile"},
new int[]{R.id.textView1, R.id.textView2});
ListView listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(adapter);
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Android ListView using SimpleCursorAdapter - ParallelCodes
ListView is view group that displays a list of scrollable items which are insterted in list using Adapter that pulls data from array...
Read more >Android: Using SimpleCursorAdapter to get Data from ...
An adapter isn't used on each item in the cursor, one adapter is created for the entire cursor.You can set this listview to...
Read more >Android SimpleCursorAdapter Example - Java Articles
This was an example about building ListView using SimpleCursorAdapter. We showed you how to create your own ContentProvider and override query() ...
Read more >SimpleCursorAdapter | Android Developers
Get the type of View that will be created by getView(int, View, ... been registered with this adapter via registerDataSetObserver(DataSetObserver) .
Read more >Populating a ListView with a CursorAdapter
In Android development, any time you want to show a vertical list of items you will want to use a ListView which is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Column(name="_id")
@agrosner Is there other way without aliasing id column?