I have an array of Password objects, each containing a tag, a username and a password (all of three S开发者_Go百科trings).
I'd like to display the tags contained in each Password in a ListView.
I thought about using an ArrayAdapter linked to a String array containing only the tags, but I'm almost sure this would be a bad option as I plan to update frequently the Password array's contents.
Is there any other option to bind my Password array to a ListView and making it display only its tag attribute?
The simplest solution:
Step #1: Implement toString() on Password to return tag
Step #2: Put your Password objects in an ArrayList<Password>
Step #3: Put your ArrayList<Password> into an ArrayAdapter<Password>
Step #4: Put your ArrayAdapter<Password> into your ListView
加载中,请稍侯......
精彩评论