This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a table with user data

 
Patrick Mahoney
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been working on my first app and I recently figured out how to get and use user data throughout my classes and activities. My question now is how to create some kind of a table to display and manipulate the data with.

Here's the main page of the app:


What I want to do is create a table underneath the line, and add an entry every time a user clicks the new saving category button. When they click that button, they are prompted for a name and a percent via an EditText and a SeekBar:


I want that stuff to get displayed here:


If it's hard to read sorry, it was done in paint. Basically I want a new row that will display the user-defined name on the left, and on the right it will display a percentage of the user defined paycheck. On the left I want the name of the category, and on the right it will say $0 until the user makes a new paycheck, after that it will display a percentage of that paycheck.

I have no idea how to start doing this, so any help is greatly appreciated.

Thanks!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
List data is generally displayed in a <ListView>. Each row of a list can be set up to have its own layout (for example, to keep the two columns apart). If the row layout is named row.xml, you'd do something like

listView.setAdapter(new ArrayAdapter<String>(this, R.layout.row, results))

assuming that "results" contains the data to be displayed. This should help: http://stackoverflow.com/questions/2432951/how-to-display-a-two-column-listview-in-android
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic