1

my android project contains a listview which is filled by a xml-file. xml file contains node:

<item ID=XXXX>VALUE</item>

I'm currently using an arraylist which stores node VALUE and its binded in my listview. On ItemClick a new activity is called where I need the ID.

Now I don't really know how to achive this:

  1. get values from xml->
  2. bind only VALUE to listview->
  3. onItemClick get the id and give it as parameter to other activity (currently giving a parameter to other activity is working with ArrayList)

1 Answer 1

1

1) Create object that holds id and value

2) Crate custom adapter based on ArrayDapter

3) Populate adapter with objects collection

4) Implement on item click and you be able to get your object

5) Get id from object and fire it

if you try to google with "android listview custom adapter" you will find many examples

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.