ParseRelation<ParseObject> p = country.getRelation("view");
ParseQuery P2 = p.getQuery();
So is it possible to intent the P2 query in the next activity ,so that we can use this query in next activity to fetch the data from parse database.
ParseRelation<ParseObject> p = country.getRelation("view");
ParseQuery P2 = p.getQuery();
So is it possible to intent the P2 query in the next activity ,so that we can use this query in next activity to fetch the data from parse database.
Sadly ParseObject
is not parcelable, which would solve hundreds of issues I had with their Android SDK.
But you can surely pass country
through its object id.
// Launching...
Intent i = new Intent(context, Destination.class);
i.putExtra(“relationObjectId”, country.getObjectId());
i.putExtra(“relationFieldName”, “view”);
startActivity(i);
// Then in Destination activity..
Intent i = getIntent();
String relationObjectId = i.getStringExtra(“relationObjectId”);
String relationFieldName = i.getStringExtra(“relationFieldName”);
Country country = ParseObject.createWithoutData(Country.class, relationObjectId);
ParseQuery query = country.getRelation(relationFieldName);
Please note that before calling getRelation() again, you might have to use fetchIfNeededInBackground()
.