Closed cychancw closed 3 years ago
Haha I solved it in a weird way.
@Override protected void onPause() { super.onPause(); smoothBottomBar.setItemActiveIndex(2); // The index of my activity }
Actually It still back to start Destination (home_Fragment)
I saw the sample and use the code below successfully to do what I meant to do. However, when I launch the activity by the SmoothBottomBar, it jumps back to the start Destination(home_fragment) first and then start the activity that I want. It looks very bad. Why would this happen? Anything I can do to solve this?
`<fragment android:id="@+id/home_fragment" android:name="com.example.home_Fragment" android:label="Home" tools:layout="@layout/fragment_home"> <action android:id="@+id/action_firstFragment_to_secondFragment" app:destination="@id/two_fragment" />
<fragment android:id="@+id/two_fragment" android:name="com.example.two_Fragment" android:label="two" tools:layout="@layout/fragment_two"
<activity android:id="@+id/my_activity" android:name="com.example.myActivity" android:label="My" tools:layout="@layout/activity_my" >
<fragment android:id="@+id/my_fragment" android:name="com.example.my_Fragment" android:label="User" tools:layout="@layout/fragment_my" />`