My app is basically used for scanning the QR code, first when user scan the qr code the product image,description,price and add to cart button is displayed.When the user click on add to cart button it proceed to another activity where he/she set product quantity,on the same activity more products icon is set,when the user click on that icon more products image is displayed here also add to cart button is placed when click on that button it proceed to another activity,where he/she set the quantity,my problem is that add to cart session is not maintained ,the previous products is not display in his/her shopping bag, the product which is select presently was store in shopping not prevoiusly.
Please help me ,how could i do this?
you asked a kind of vague question, so I assume you are looking for a strategy rather than specific code.
There are two ways that I can think of that you could approach this. Basically you are looking to maintain information between activities. You could use an application class that stores your clicked items, or you could save the session activity into an sqlite database.
I recommend the first option, the application level class. Basically this is a class that sits above all your activities, at application level, and is accessible to all of them as well as to services and broadcast receivers etc. I think of it as being equvilant to using SESSION variables in php.
theres a link to an article on global variables in android via applications:
http://trace.adityalesmana.com/2010/08/declare-global-variable-in-android-via-android-app-application/