1. Are you ready for the Galaxy S20? Here is everything we know so far!

Create UI Items Dynamically and Call them

Discussion in 'Android Development' started by Gamesterdude, Aug 6, 2010.

  1. Gamesterdude

    Gamesterdude Lurker
    Thread Starter

    There are threads similar but not quite what I am looking for.
    I want to be able to create buttons dynamically during run time when the user clicks the "New" button inside the menu.
    I then need a way to dynamically name these buttons so i can call them for individual actions.
    Any code or tips would be helpful. I know in c++ i would just create an integer counter and use that to name new items using string conversion but i dont think i can do that here.
     



    1. Download the Forums for Android™ app!


      Download

       
  2. jonbonazza

    jonbonazza Android Expert

    You do this just like you would in normal java. Create an instance of the Button class and then set its properties via the particualr methods and then add it to a layout.
     
Loading...
Similar Threads - Create Items Dynamically
  1. louis2008
    Replies:
    4
    Views:
    649
  2. soulartist
    Replies:
    14
    Views:
    941
  3. Relaxing Leg
    Replies:
    0
    Views:
    582
  4. Sajivjess
    Replies:
    1
    Views:
    668
  5. RicardoM
    Replies:
    1
    Views:
    682
  6. My project
    Replies:
    9
    Views:
    907
  7. grizmixstir
    Replies:
    3
    Views:
    1,320
  8. kdmoore
    Replies:
    3
    Views:
    1,446
  9. cwg01
    Replies:
    3
    Views:
    3,257
  10. kumaranil13k
    Replies:
    4
    Views:
    1,367

Share This Page

Loading...