I know its a common question, but I couldn't find information related to my contexts. First, I am building a String from JSon objects coming from different classes using Gson:
String myString= gson.toJson(obj);
String mystring1=gson.toJson(obj1);
...
then I am building a String which I want to deserialize latter on , I use:
String serializedString=myString.concat("|" +mystring1);
I use | because its not contained in any of the json objects, and I thought that I will I can then easily get an array of strings with: String [] arrayOfJsonStrings=serializedString.split("|"); gson.fromJson(arrayOfJsonStrings[0],obj.class); .....
the problem is that String [] arrayOfJsonStrings=serializedString.split("|"); is returning empty string, why ?Is there easy way to achieve that ?