android - How to Pass object from sub activity to main activity? -


from activitya i'm starting activityb.
in activityb i'm creating new serializable object.
after object has been created want close activityb , pass new object activitya.

how can it?

start activity b startactivityforresult().
in activity b, when object created create intent pack object in:

intent result = new intent(); result.putextra("result", object); setresult(result_ok, result); 

then receive intent in onactivityresult() method of activity a, can extract so:

data.getserializableextra("result"); 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -