2012-02-15 31 views

回答

0

如果你使用Cursor填充數據,那麼你可以很容易地找到它.cursor.getcount()將給出記錄的總數。 如果條件適用。

int records = 0; // record will contain the counter for record 

for(int i=0;i<cursor.getCount();i++) { 
record = i; 
    if(records == cursor.getcount() { 
    // this will give the last record 
    } 
} 
0

定義的getItem()適配器的方法,以returrn歌曲條目(自定義結構或哈希映射/哈希表),並最後一個項目從適配器,使用取:

SongItem item=adapter.getItem(adapter.count()-1); 

,並使用此項目獲取ID,專輯等

相關問題