Reputation: 1254
How do I determine where the screen is placed after pressing the back button from a different activity.
or
How do I make it so I can have the screen scrolled down more on Activity1 after pressing the back button on Activity2?
Upvotes: 0
Views: 26
Reputation: 849
What I understood from you question is, you want to get back to Activity1 from Activity2 while keeping the scroll state of Activity1 where it was before going to Activity2.
if so, you don't have to worry about the scroll state of Activity1 and Android save state for all the views when activity goes to pause while either moving next Activity2 or even when sent to background
Another thing I understood was, you want scroll position to change on coming back from Activity2, for this, you can start Activity2 with startActivityForResult and on receiving the result you will know app is coming back from Activity2 to Activity1 and scroll Activity1 using scrollTo() method (depends on what view you are using for scrollable activity)
Hope it answers your query
Upvotes: 1