Adding ListView Sub Item Text in Android

前端 未结 4 1264
忘了有多久
忘了有多久 2020-12-02 10:52

I have created an RSS reader that lists items in a listview. I also want a date below each item, but I have no idea how to do that. I need someone\'s help to make the Sub

4条回答
  •  遥遥无期
    2020-12-02 11:17

    Since you want to map multiple data items to multiple views, you can't use an ArrayAdapter. You'll have to use a SimpleAdapter instead.

    Also, I noticed you're getting the RSS feed on the main UI thread. This is going to cause your application to be highly non-responsive. If you don't know what I'm talking about, take a gander at the Painless Threading article (I consider it a must read for any android developer). What you should do instead is use a Loader. They were designed for exactly you type of situation. Although they weren't introduced until API-10 you can still use them on lesser API levels via the Support Package.

提交回复
热议问题