0

I am trying to show SearchResultBaseFragment(class name) fragment, some time it's not visible but fragment code run in background, how to figure out the error, log cat shows nothing...

FragmentManager  fragmentManager = getSupportFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 Fragment currentFragment = new SearchResultBaseFragment();
                fragmentTransaction
                        .add(R.id.frame_container, currentFragment)
                        .setCustomAnimations(R.anim.frg_slide_for_in,
                                R.anim.frg_slide_for_out,
                                R.anim.frg_slide_back_in,
                                R.anim.frg_slide_back_out)
                        .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                        .addToBackStack(null);
               fragmentTransaction.commitAllowingStateLoss();

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/mainLayout"
    android:background="@color/white"
    >
    <FrameLayout
        android:id="@+id/frame_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
         >
    </FrameLayout>
    <include
        android:id="@+id/actionBarRootLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/actionbar_layout"
        android:layout_alignParentBottom="true" />
</RelativeLayout>

Fragment class

public class SearchResultBaseFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //View v = inflater.inflate(R.layout.activity_slide_profile, null);
        View v = inflater.inflate(R.layout.dl, null);

        return v;
    }

    @Override
    public void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
    }

    public SearchResultBaseFragment() {
        this._lat = 0;
        this._long = 0;
    }

    public SearchResultBaseFragment(double _lat, double _long) {
        this._lat = _lat;
        this._long = _long;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    [...]

}
alex
  • 8,904
  • 6
  • 49
  • 75
Nitesh Shrivas
  • 105
  • 1
  • 10

0 Answers0