Reputation: 11608
Situation
In my alarm clock app I start a NewAlarmActivity
by clicking a button.
After the user has made all the selections, alarm gets set and `finish() is called.
The matter
I create a new LinearLayout
object with images and text within it. That layout must be added to the screen of previous activity (to another LinearLayout
placed inside a ScrollView
) so the user is able to see the alarm set. Somehow I have to pass that LinearLayout
object to the first activity and tell it to receive and add the object to the screen.
How can I do that?
Upvotes: 0
Views: 132
Reputation: 18253
You just need to read some documentation about startActivityForResult()
.
BTW, IMHO, you should not transport your LinearLayout
object between activities, that's ugly.
How to manage `startActivityForResult` on Android?
Starting Activity And Getting Result
This has been asked countless times...
Upvotes: 2
Reputation: 13541
No You don't have to do this. Try the approach of storing your data into a database and then when going into that Activity, build your layout according to the data you have. This is a much better way than passing a layout from one Activity to antoher.
Upvotes: 1