This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a table with user data

 
Patrick Mahoney
Greenhorn
Posts: 3
  • 0
  • 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
Pie
Posts: 42966
73
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic