Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Basically the app starts on the main screen where i want the inventory array to be. there is a button that takes you to another screen and allows you to enter information and create an item object. When I click the add button id like to send the item back to the main screen via intent and have it add it to the inventory. Or alternatively click the back button and return to the main screen with no item.

Where i'm confused is how the main screen know when its being:
a) Launched for the first time
b) if there is an item to add from being started by the add button
c) to just relaunch and not reinitialize my array
Posted

1 solution

Your question is not very clear. However I suspect you want to pass information between different intents. You can do this by using the Parcelable class[^], or the putxxxExtra and getxxxExtra methods of the Intent class[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900