Tuesday, March 22, 2011

Android Programming Help

This is some good basic info I found really helpful. Here a cursor is opened to the database and data is fetched into an ArrayList

Also note that it is better to define what type of data will be in an ArrayList like:
ArrayList myResults = new ArrayList();



ArrayList myResults = new ArrayList();
Cursor c = db.query(...your Query Parameters here...);
c.moveToFirst();
while(!c.isAfterLast())
{
myResults.add(c.getString(1));
c.moveToNext();
}

No comments:

Post a Comment