Hi, Here I am using SimpleCursorAdapter class as
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME,
MODE_PRIVATE, null);
try
{
sampleDB = this.openOrCreateDatabase(SAMPLE_DBNAME,
MODE_PRIVATE, null);
Cursor c = sampleDB.rawQuery ("SELECT _id,RoomName,
SwitchFullName FROM SwitchTable ORDER BY RoomName",null);
startManagingCursor(c);
String[] columns = new String[] {"RoomName",
"SwitchFullName","_id"};
int[] names = new int[] {R.id.room, R.id.switch1,R.id.id};
myAdapter = new SimpleCursorAdapter(this, R.layout.schedule,
c, columns,names);
setListAdapter(myAdapter);
}
catch (SQLiteException se )
{
Log.e(getClass().getSimpleName(), "Could not create or Open
the database");
}
finally
{
//sampleDB.close();
}
}
On Dec 18, 10:18 am, TreKing <[email protected]> wrote:
> On Fri, Dec 17, 2010 at 9:17 PM, pramod.deore <[email protected]>wrote:
>
> > Hi, here is .xml file
>
> This only shows one row. How is the second row getting in there?
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en