Lets say we have an object of Class Person with all String parameters :
Class Person {
String name;
String email;
}
Person p = new Person();
p.name = "ABC";
p.email = "[email protected]";
How do we convert object p to ArrayList of NameValue Pair :
Output should be a ArrayList<NameValuePair>
with following content :
"name" : "ABC"
"email" : "[email protected]"
Here you are .. it's a dynamic so you can use it for any object .. I'm using the reflection
this output will be
considering that the NameValuePair implementation is
}
I hope this could help!