How Can Pass List from Activity to Activity in Android?
Contents How Can We Pass List of Objects from One Activity to Another in Android? Passing the Custom Object in Activity, Pass It to the Activity, Intent Intent...
Contents
How can we pass list of objects from one activity to another in Android?
passing the custom Object in activity,
- Pass it to the activity, Intent intent = new Intent(getActivity(), Activity. class); intent. putExtra(“list”, (Serializable) mainData. getData(). getFeaturedProduct()); getActivity(). …
- And get it. ((List<HomeProductsModel>) getIntent(). getExtras(). getSerializable(“list”))
30 сент. 2017 г.
How pass data from ListView to another activity in Android?
6 Answers. Implement ListView ‘s OnItemClickListener, once you handle this event, try to get the location of the row that was clicked. Once you get it, access that particular row position in the source array (or whatever else you’re having). This way, you’ll have the data that you want to pass to another activity.