-1

I have an activity that contain a listview. My listview has many pictures. When user touch a picture, second activity start with shared element transition. Second activity contains viewerpager that shows pictures in first activity. I want when user press back after change current picture, return transition back to current picture item with animation. By default sample of shared element transition,when user press back return transition animation back to first item that user touch it.

No Body
  • 671
  • 5
  • 14

2 Answers2

0

try use listView.setSelection(position) in onResume method

Or for smooth scroll listView.smoothScrollToPosition(position);

Tim
  • 92
  • 7
0

Check this sample project: https://github.com/alexjlockwood/activity-transitions

The key point: you have to tell activity 1 a new position of shared element.

sdex
  • 3,169
  • 15
  • 28