• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting values from one Activity to the next.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been working on my first Android app for a little while, and I pretty much have the user interface done. I've been very happy with my progress so far, but recently I ran into my first real problem.

I need to get these values:

and use them on the home screen part:

I'd like to be able to save the name and percent and create a new entry on a table below the buttons that will display the name and the percent. After that, I want to be able to take input from here:

And divide it amongst the categories.

Any help is much appreciated, I'm of course not looking for someone to completely do the work for me, just lend me a helping hand.

p.s. Sorry the pictures are big, didn't take the time to worry about resizing or anything like that.

p.p.s. Remember that this is my first app, and I really haven't done much programming in my life before, so please explain everything like I'm a beginner.
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can pass all kinds of information to the newly started activity along with the Intent that starts it. Check out the Intent.putExtra method.
 
Patrick Mahoney
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You can pass all kinds of information to the newly started activity along with the Intent that starts it. Check out the Intent.putExtra method.



Thanks, I did exactly that. I changed some code around in the main activity so that instead of startActivity() it is now startActivityForResult() and I now use that to get the values from two different activities. After that I use Intent.getExtra().

Thanks for your help!
 
reply
    Bookmark Topic Watch Topic
  • New Topic