@@ -134,10 +134,6 @@ public void onActivityCreated(Bundle savedInstanceState) {
134134 // Initialize ViewPager and adapter
135135 mFragPagerAdapter = new TunnelsPagerAdapter (getChildFragmentManager ());
136136 mViewPager .setAdapter (mFragPagerAdapter );
137- // Make sure the ViewPager has proper height
138- /*mViewPager.setLayoutParams(new ViewGroup.LayoutParams(
139- ViewGroup.LayoutParams.MATCH_PARENT,
140- ViewGroup.LayoutParams.MATCH_PARENT));*/
141137
142138 setupMagicIndicator ();
143139
@@ -305,19 +301,19 @@ public final void onTunnelSelected(int tunnelId, Pair<View, String>[] pairs) {
305301 .replace (R .id .detail_fragment , detailFrag )
306302 .commitNow (); // Use commitNow() to execute synchronously
307303 } catch (Exception e ) {
308- // This exception might occur if the fragment transaction fails due to an invalid state.
309- // It is handled by logging the error to help with debugging.
310304 Log .e ("TunnelsContainer" , "Failed to update detail fragment" , e );
311305 }
312306 } else {
313307 // In single-pane mode, simply start the detail activity
314308 // for the selected item ID.
315309 Intent detailIntent = new Intent (getActivity (), TunnelDetailActivity .class );
316- ActivityOptionsCompat options = ActivityOptionsCompat .makeSceneTransitionAnimation (getActivity (), pairs );
317- detailIntent .putExtra ("tunnel_id" , tunnelId );
318- ActivityCompat .startActivity (getActivity ().getApplicationContext (), detailIntent , options .toBundle ());
310+ detailIntent .putExtra (TunnelDetailFragment .TUNNEL_ID , tunnelId );
311+
312+ ActivityOptionsCompat options = ActivityOptionsCompat .makeSceneTransitionAnimation (
313+ getActivity (), pairs );
314+ ActivityCompat .startActivity (getActivity (), detailIntent , options .toBundle ());
319315 }
320- }
316+ }
321317
322318 // TunnelDetailFragment.TunnelDetailListener
323319
0 commit comments