今天的问题是要从一项活动回到特定的片段。我想这样做,就像ParentActivityName一样,在工具栏中带有一个onbackpressed箭头。我想到了诸如回想包含片段的活动之类的东西,但是当它恢复时,它不会显示正确的片段。有什么想法吗?
<activity
android:parentActivityName=".Main2Activity"
android:name=".Register"
android:theme="@style/AppTheme.NoActionBar2"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"/>
您有onBackPressed的代码吗?请显示它,以便我们检查是否有任何问题