I am new at developing Android App.I have a MainActivity that has a ListView.The data on Listview is hold in a Arraylist.(I dont have any DB).Listview items has 4 field such as coursecode,coursetitle,courselevel,coursedescription.When I clicked an item on Listview,a new activity(ShowDetailActivity) will be launced in order to view detail of course.The editable of the EditViews on ShowDetailActivity are false.On ShowDetailActivity I have an option menu item (Edit).When I clicked the Edit option menu item,a new activity(EditCourseDetailActivity) will be launched and the the user will be edit details of course.
Edited detail of the specific course on EditCourseDetailActivity must be transfer to ShowDetailActivity and then to MainActivity
I dont know I could explain?
How can I handle this situation please help me !!!! Thanks for your comment in advanced
MainActivity ---> ShowDetailActivity ---> EditCourseDetailActivity ---- | | MainActivity <----ShowDetailActivity <---------------------------------
Look at this topic. It is similar to your situation.
In you case, the idea is to send the data throught the Intent to your different activities. The modified data will be send back to the activity by the same process.
I believe that your object in the ArrayList must be Serializable.
You will find explainations in these links:
P.S.: Use the startActivityForResult and onActivityResult to get the Intent as explained by tiago7
For ListView (MainActivity), you can do setOnItemClickListener. For example:
MainActivity.java
DetailScreen.java
This is how you receive from MainActivity.
Then when Edit button is clicked, use the intent to go to next activity (EditCourseDetails).