How to filter an ArrayList in android using Java
7 March, 2022
9
9
0
Contributors
So we all have seen that in android if we want to pass Data from one activity to another we generally do with the Intents and sometimes with bundle.
But sometimes we are in a need of large data filtering from one activity to another, let me clear it. Suppose if you want to filter an arrayList by using just another single activity apart from MainActivity then we are in a big difficulty.
So there is a away that we can do that with intents, but why do we make our code complex to understand if the same thing we can do it with Bundle class.
let me Clear it for you
Whenever we use intent.putExtra() to map the bundle with a name at runtime our application somtimes crashes while filtering the arraylist to another activity
so for that intent.putExtras() is used
Here is the Code to filter an arrayList in mainActivity.Java
Now in another activity we can get this arrayList using the same bundle Activity2.Java
So by doing this way we can filter any type of arrayList in android and we can reduce the use of lots and lots of activities.
java
android