Trouble In Featching Data From Tables
When user add album it show in ListView. suppose you select lovesong album that user write song name and title and save to song table(songid,albumid,songname,songtitle). for getti
Solution 1:
Your database seems to be returning 0 rows, try wrapping your while loop in if(c.moveToFirst()) so
if(c.moveToFirst())
{
while(c.moveToNext())
{
myDatas=new Alldata();
myDatas.song_id=c.getLong(c.getColumnIndex(KEY_SONG_ID));
myDatas.album_id=c.getInt(c.getColumnIndex(KEY_ALBUM_ID));
myDatas.song_name=c.getString(c.getColumnIndex(KEY_SONG_NAME)).trim();
myDatas.song_title=c.getString(c.getColumnIndex(KEY_SONG_TITEL)).trim();
arrayList.add(myDatas);
}
}
Post a Comment for "Trouble In Featching Data From Tables"