0

I created a list based on this example:

http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/

In GetView method, need to access information that is stored only in the HashMap. I can access using "adapter.getItem (position). ToString ()" but this way, keys and values ​​come together in a single string, like this:

{date=2011-07-25 19:30:00, id=1, caption=Test Caption, title=Test Title, bookmark=true}

You can retrieve this data separately? For example, only the value of "bookmark" field

Please include an example. I am new to developing for Android.

Roy Sharon
  • 3,488
  • 4
  • 24
  • 34

1 Answers1

3

remember that you know the data type that is used with the adapter.

instead of using toString, just get the item and use it as you usually do.

for example:

HashMap<String, String> i = (HashMap<String, String>) adapter.getItem(position);
i.get(ITEM_TITLE);
Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131