1. Download our Official Android App: Forums for Android!

Button, text boxes added at runtime with functionality

Discussion in 'Android Apps & Games' started by JohannN, Feb 2, 2014.

  1. JohannN

    JohannN Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    4
    Joined:
    Feb 2, 2014

    Feb 2, 2014
    4
    0
    25
    Male
    Programmer for Automation Works
    Swellendam, South Africa
    I am trying to add buttons and text boxes at runtime and have functionality added to it.
    Got so far as adding the buttons and text boxes, but having a battle to actually add actions to it and having the app open again with the buttons, text boxes and their actions.
    Anyone done something like this on Android already that can point me in the right direction please?
     

    Advertisement

  2. vosg

    vosg Android Expert
    Rank:
     #118
    Points:
    203
    Posts:
    1,234
    Joined:
    Aug 12, 2010

    Aug 12, 2010
    1,234
    360
    203
    Male
    Software Developer (retired)
    Antwerp, BE
    I never really wrote apps for Android, but I have for the Windows platform. To achieve what you want, one would typically place the objects at design time and change their 'visible' attribute at runtime. I don't think it's different for Android...
     
    JohannN and funkylogik like this.
  3. JohannN

    JohannN Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    4
    Joined:
    Feb 2, 2014

    Feb 2, 2014
    4
    0
    25
    Male
    Programmer for Automation Works
    Swellendam, South Africa
    Thanks, I thought of going that direction, and then having a db to store specific variables for the controls as selected by the user. Also did something almost like it in Windows, but not sure it was the best way for Android.
     
  4. vosg

    vosg Android Expert
    Rank:
     #118
    Points:
    203
    Posts:
    1,234
    Joined:
    Aug 12, 2010

    Aug 12, 2010
    1,234
    360
    203
    Male
    Software Developer (retired)
    Antwerp, BE
    You're welcome.
     

Share This Page

Loading...