The data gets called perfectly from the parse because i can see the correct value of String caption in the Toast that is inside the method done(); but as soon as it gets out of the done(), The second Toast displays null.
So i tried passing the value of caption to the intent inside the done() but it doesnt get passed to the other SingleItemView.class
I've checked if all the spellings in the other class' getExtraString are the same and they are..
Forget the Intent Part, if anyone could tell me why the correct value gets shown in the first Toast message but the second Toast message shows null, that'd be great
Can anyone tell me what i might be doing wrong here?
Thanks
'caption' is a public string.
final Intent i = new Intent(context, SingleItemView.class);
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>(SchoolClass);
query.getInBackground(post.get(position).getObjectId(), new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
// TODO Auto-generated method stub
caption = object.getString("caption");
i.putExtra("Caption", caption);
Toast.makeText(context, caption, Toast.LENGTH_LONG).show();
}
});
Toast.makeText(context, caption, Toast.LENGTH_LONG).show();
context.startActivity(i);