question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can create listView via simpleCursorAdapter

See original GitHub issue

DBFlow 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:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
agrosnercommented, Jun 12, 2016

@Column(name="_id")

0reactions
msoa7commented, Jun 2, 2016

@agrosner Is there other way without aliasing id column?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found