Displaying Contact Number and Contact Name in a custom list view

后端 未结 2 1663
北荒
北荒 2020-11-29 09:08

Can anyone tell me how should i display the phone number and the contact name in a custom list view? The code is pasted below

import android.app.Activity;
im         


        
2条回答
  •  被撕碎了的回忆
    2020-11-29 09:32

    I think you should call cursor.moveToFirst() again before passing it to the SimpleCursorAdapter, as right now you're sending a "finished" cursor.

    Besides that, your code seems fine. You can compare it to the code here, which does something similar (But with a user-defined database).

提交回复
热议问题