1

I'm very disappointed.

In my activity where i also start the fragment, i have a fragment view, and i call the method from another fragment by using the findFragmentById and then the fragmentview id.

onCreate in my activity:

        frgmntView = (FrameLayout) findViewById(R.id.frgmntView);

        mFrgmntManager = getSupportFragmentManager();

        gmm = (GlobalMultiMenu) mFrgmntManager.findFragmentById(R.id.frgmntView);

        startMenu();

And another void where i call the method:

public void startMenu() {
            mFrgmntTransaction = mFrgmntManager.beginTransaction();
            mFrgmntTransaction.setCustomAnimations(R.anim.fade_in, R.anim.fade_out);
            mFrgmntTransaction.replace(R.id.frgmntView, new GlobalMultiMenu()).commit();
            actualFrgmnt = 0;

            gmm.updateBottomItems();

            isDoingTurn = false;
        }

But this returns null pointer, please help. Thanks

theMatus
  • 153
  • 1
  • 9

1 Answers1

0

make that Method Static

And call it.

Example :

FragmentName.MethodName();

Uttam Panchasara
  • 5,735
  • 5
  • 25
  • 41