ScrollView Add Button Dynamically

  • Replies:2
Nathan Gorecki
  • Forum posts: 2

Apr 20, 2016, 2:08:43 AM via Website

I am new to java development and might have bit off more than I could chew. I'm trying to create an inventory app that allows a user to hold a running inventory of what they have.

On activity 1 there is a scrollview and 2 buttons; an add button and a delete button. The add button opens up to activity 2 with data fields. Once those data fields are populated, the user taps the add button on activity 2. This button does 2 things: 1 causes a button to be added into the scrollview in activity 1 and 2 creates a data entry so when the button in the scroll view is tapped, the user can view the inventory items data. Each button added has the text of the name of the inventory item added.

The code needs to add a button to the scrollview while the app is out of development?

I am thinking that the data is stored in an sql database. Then called upon but that's further down the road.

I hope I am explaining this so you can understand.

thanks for the help in advance!

Reply
Vladimir S.
  • Forum posts: 266

Apr 20, 2016, 1:27:03 PM via Website

Hi, i think you need ListView instead of ScrollView in activity 1. Read more about ListView and it's data control.

Reply
AuroraHope
  • Forum posts: 8

Apr 25, 2016, 5:21:52 PM via Website

second that. go for listview as it's the right way to approach your problem.

Reply