android-cursor Questions
7
Solved
I have sorted and listed my phone contacts in to an arraylist but ,i got many duplicates of same contact names in the list .How this happens? how to avoid this?
This is what i have tried,
cursor...
Bibliography asked 13/12, 2017 at 5:42
1
I want to execute cross-database query in SQLite in Android. I have two tables in two different databases.
attach database 'data/data/com.app/databases/db1' as db1;
attach database 'data/data/com...
Strontium asked 3/11, 2017 at 7:10
7
Solved
Here's my issue:
I have a database and it is full of episodes of a tv show. One column denotes the episode number. I want to display the episodes in a list like this:
Episode 1
Episode 2
Episode ...
Duologue asked 26/7, 2011 at 1:25
5
Solved
I have database table with the columns {Name, Time (UTC format) , Latitude, Longitude}
I display the table using a ListActivity with a SimpleCursorAdapter.
I would like that the column Time show ...
Anticipant asked 31/8, 2010 at 12:43
1
Solved
I have to execute a query and store the result in a list, the function that I use is this follow :
List<SpoolInDB> getSpoolInRecords(String label, boolean getLastInserted) {
List<SpoolIn...
Ealasaid asked 14/8, 2017 at 15:12
3
Solved
I did research on how to use ContentProviders and Loaders from this tutorial
How I see it:
We have an Activity with ListView, SimpleCursorAdapter and CursorLoader. We also implement ContentProvide...
Kipton asked 7/2, 2014 at 9:19
3
Solved
My Activity contains this code to get all images on the SD card:
String[] projection = {MediaStore.Images.Media._ID,
MediaStore.Images.Media.DATA,
MediaStore.Images.ImageColumns.DATA};
Cursor c...
Neuritis asked 14/3, 2012 at 6:16
1
This is fragment activity it force closed when i press home button, error is Attempted to access a cursor after it has been closed. Where is error. i also try getContentResolver().query() instead o...
Stephniestepladder asked 13/1, 2015 at 9:37
2
Solved
Consider the scenario as in this picture:
Three photos, one of them is a large GIF file (3MP).
I'm querying MediaStore in order to retrieve the correspondent thumbnails. If I initialize the C...
Breastbeating asked 30/11, 2012 at 19:33
2
Solved
Trying to implement LoaderManager + CursorLoader.
In onFinish method adapter should swap its cursor
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
// Swap the new cursor...
Embonpoint asked 14/6, 2012 at 7:21
7
Solved
I was going through some of code on the internet regarding the database connection, retrieval. I saw Cursor cur1= moveToFirst() in a lot of code and I want to know what the use of a cursor is and w...
Organic asked 30/3, 2012 at 7:10
4
I'm using a SimpleCursorAdapter to display results in a ListView but since I've got to query my database lots of times during a search (using the SearchView widget) it worries me that the cursor mi...
Adonic asked 30/9, 2014 at 20:3
2
Solved
I have created one Activity in that I am implementing CursorLoader for load data from Database.
I have done that thing for all records of that Table but I want to load 30-30 records like Load More...
Flagging asked 3/10, 2016 at 5:34
5
Solved
Here my Contact names are Displayed on List View . By clicking the List I get ContactName and Contact Id. From that I want to fetchPhone number by Using either Contact ID or Contact name,Please Hel...
Resistless asked 10/3, 2012 at 7:24
0
Since Java introduced this statement since 1.7, I adopted this rule to write my cursor-related statement like this:
try (Cursor cursor = context.getContentResolver().query(queryAccountUri, null, n...
Nebo asked 30/9, 2016 at 4:26
7
Solved
Which of the following two should I be using to make sure that all the cursors are closed?
Cursor c = getCursor();
if(c!=null && c.getCount()>0){
try{
// read values from cursor ...
Parapet asked 10/11, 2010 at 12:15
3
Solved
In getView() of CursorAdapter, there's a parameter position so I can do a checking for that position, how can I do the same on bindView() it has no position parameter in BindView.
Currently I'm o...
Crackpot asked 28/1, 2013 at 2:32
3
Solved
I'm implementing an AutoCompleteTextView and I need Name and E-Mail of all my contacts.
I found this snippet that I'm running asynchronously but it's very slow.
ContentResolver cr = getContentReso...
Belongings asked 24/8, 2012 at 12:26
4
Solved
What is difference between ContentObserver and DatasetObserver?
When one or another should be used?
I get Cursor with single row. I want to be notified about data changes - eg. when row is update...
Insect asked 25/3, 2011 at 9:52
6
Solved
I've fetched the records from Database using Cursor. It works perfectly, but, I get errors in Logcat while I'm using this code
public Cursor fetchAll()
{
SQLiteDatabase db = this.getReadableDataba...
Consistent asked 16/12, 2011 at 9:52
3
In typical Android project where we need to pull data from somewhere (REST, SQL, cache, etc) into the UI in a clean way we commonly use a Loader, Service or (possibly, yuk) an AsyncTask, but I find...
Ubiety asked 20/2, 2015 at 12:55
3
Solved
I'm trying to use a SimpleCursorAdapter with a ViewBinder to get an image from the database and put it into my ListView item view. Here is my code:
private void setUpViews() {
mNewsView = (ListVie...
Yet asked 15/7, 2011 at 16:57
1
Solved
How to find cursors that are not closed in whole project that may cause memory leaks and other problems since Android lint warns them now?
Luster asked 4/5, 2016 at 5:30
1
I'm making a query on the Android's MediaStore Files Database -MediaStore.Files.getContentUri("external") - and, for some specific folders, both the MediaStore.MediaColumns.TITLE, and MediaStore.Me...
Pietro asked 5/5, 2016 at 10:41
0
I have an android app that uses a service to collect sensor data every 5ms and inserts it into a sqlite table. In a typical session there will be about 40mins of recordings. All of that code seems ...
Joli asked 27/4, 2016 at 1:50
© 2022 - 2024 — McMap. All rights reserved.