I am new to android field. i am developing restaurant menu application, i have created list view which shows names of items in restaurant. when i select any one item in list view it will launch another activity, it contains text view field showing detail description of selected item. similarly when i select other items, it should launch same activity but data should be of that selected item, how to achieve this ? if i use sqlite database for data source.
Share
You need to pass the values onItemClick:
If you want some data back from called Activity then you can use startActivityForResult() as:
In called activity you can set data as:
Note: Here you set the value in intent and pass it to setResult().
On returning back to calling Activity you can get data by overriding:
Note: You can pass primitive data type values thru Intent and if you want to pass other types then you have to use Bundle like this.
Receiving data in Activity: