문제

I have 3 fragment activities: home screen, a news feed, and an article view. Clicking the button on the home screen opens the news feed, clicking an article in the news feed opens the article view. But when I click the "Back" button in the article view, it returns to the home screen.

Is there any reason it would be skipping the previous activity? How do I make sure it goes back to the calling activity rather than the home screen?

도움이 되었습니까?

해결책

I fixed the problem by adding android:alwaysRetainTaskState="true" to the activities that opened the article.

I think the issue was that the activity was getting destroyed when I switched to the article activity and when it tried to go back there was nothing there.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top