-1

I have a list of Strings (Video tags) and I wanna show each of them in a button (same as when you want to send a text for multiple users) and when I click on each an action happens for that box. I took a look at:

https://github.com/kpbird/chips-edittext-library

It generate each string in a box but finally I don't have access to specific item onclick.

Does anyone has any suggestion what to use or how to make it?!

Rudi
  • 4,304
  • 4
  • 34
  • 44
  • 1
    Please show your code then we may suggest something. – XorOrNor Oct 30 '13 at 10:19
  • @soulreaver I don't have a code for that yet. Imagine there is a ArrayList and I want each item to be a Button and place after each other. – Rudi Oct 30 '13 at 10:26
  • http://stackoverflow.com/questions/7195056/how-do-i-programmatically-add-buttons-into-layout-one-by-one-in-several-lines – XorOrNor Oct 30 '13 at 10:32
  • @Rudi, have you read this ? http://stackoverflow.com/about what you want is creating a button programmatically ... http://bit.ly/17wycbp – 2Dee Oct 30 '13 at 10:33

1 Answers1

0

Read out the array of strings and programmatically add a button with the text of each string to for example a LinearLayout.

pseudo code:

ArrayList<string> list = getResources.array("id");

LinearLayout l = (Linearlayout) findViewById(R.id.linearlayout);
foreach(String s in list)
{
   l.addView(new Button(s));
}

Something like that.

Fabian
  • 356
  • 1
  • 5
  • 15