0

I have followed ViewPager FragmentPagerAdapter Nullpointer but no help. Any solution to it would be appreciated. Please note that i have imported classes from Support library only.

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;

Here is the crash log I received in Splunk Mint

java.lang.NullPointerException at android.support.v4.app.BackStackRecord.doAddOp(BackStackRecord.java:416) at android.support.v4.app.BackStackRecord.add(BackStackRecord.java:411) at android.support.v4.app.FragmentPagerAdapter.instantiateItem(FragmentPagerAdapter.java:99) at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:837) at android.support.v4.view.ViewPager.populate(ViewPager.java:987) at android.support.v4.view.ViewPager.populate(ViewPager.java:919) at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) at android.view.View.measure(View.java:15575) at android.widget.LinearLayout.measureVertical(LinearLayout.java:833) at android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at android.view.View.measure(View.java:15575) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399) at android.view.View.measure(View.java:15575) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5107) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:15575) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5107) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396) at android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at android.view.View.measure(View.java:15575) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5107) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2423) at android.view.View.measure(View.java:15575) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2031) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1249) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1425) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1142) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4724) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) at android.view.Choreographer.doCallbacks(Choreographer.java:555) at android.view.Choreographer.doFrame(Choreographer.java:525) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4947) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(Native Method)

Here is the code for my FragmentPagerAdapter.

private class MyPageAdapter extends FragmentPagerAdapter {

/**
 * Instantiates a new my page adapter.
 *
 * @param fm the fm
 */
public MyPageAdapter(FragmentManager fm) {
    super(fm);
}

/* (non-Javadoc)
 * @see android.support.v4.app.FragmentPagerAdapter#getItem(int)
 */
@Override
public Fragment getItem(int position) {
    Fragment fragment = null;
    try {
        TypedArray a = null, b = null;
        int attributeResourceId = 0, attributeStepsId = 0;

        switch (currentLocale.toString().trim()) {
        // if (currentLocale.toString().trim().equals("ar")) {
        case "ar":
            if (position == 0) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });

                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step2_line2, attributeStepsId);
            } else if (position == 1) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step2 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step2 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step2_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }

            else if (position == 2) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard3_ar });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step3 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard3_ar });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step3 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step3_title, R.string.activity_wizard_help_step3_line2, attributeStepsId);
            }

            else if (position == 3) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard4_ar });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step4 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard4_ar });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step4 });
                }
                attributeResourceId = a.getResourceId(0, 0);

                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step4_title, R.string.activity_wizard_help_step4_line2, attributeStepsId);
            }
            else {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }
            // } else {
            break;
        case "en":
            if (position == 0) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard2 });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard2 });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step2_line2, attributeStepsId);
            } else if (position == 1) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step2 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step2 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step2_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }

            else if (position == 2) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard3 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step3 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard3 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step3 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step3_title, R.string.activity_wizard_help_step3_line2, attributeStepsId);
            }

            else if (position == 3) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard4 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step4 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light,

                    new int[] { R.attr.wizard4 });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step4 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step4_title, R.string.activity_wizard_help_step4_line2, attributeStepsId);
            }

            else {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });

                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }
            break;
        case "hi":
            if (position == 0) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });

                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step2_line2, attributeStepsId);
            } else if (position == 1) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step2 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step2 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step2_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }

            else if (position == 2) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard3_hi });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step3 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard3_hi });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step3 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step3_title, R.string.activity_wizard_help_step3_line2, attributeStepsId);
            }

            else if (position == 3) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard4_hi });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step4 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard4_hi });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step4 });
                }
                attributeResourceId = a.getResourceId(0, 0);

                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step4_title, R.string.activity_wizard_help_step4_line2, attributeStepsId);
            }

            else {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }
            break;
        case "ur":
            if (position == 0) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });

                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard2 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step2_line2, attributeStepsId);
            } else if (position == 1) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step2 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step2 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step2_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }

            else if (position == 2) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard3_ur });

                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step3 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard3_ur });

                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step3 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();

                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step3_title, R.string.activity_wizard_help_step3_line2, attributeStepsId);
            }

            else if (position == 3) {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard4_ur });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step4 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard4_ur });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step4 });
                }
                attributeResourceId = a.getResourceId(0, 0);

                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step4_title, R.string.activity_wizard_help_step4_line2, attributeStepsId);
            }

            else {
                if (Util.getSharedPref(WizardHelpActivity.this).getInt("Theme", ConstantData.AppTheme.Dark.getValue()) == ConstantData.AppTheme.Dark.getValue()) {
                    a = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Dark, new int[] { R.attr.step1 });
                } else {
                    a = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.wizard1 });
                    b = getTheme().obtainStyledAttributes(R.style.Light, new int[] { R.attr.step1 });
                }
                attributeResourceId = a.getResourceId(0, 0);
                attributeStepsId = b.getResourceId(0, 0);
                a.recycle();
                fragment = WizardHelpPageFragment.getInstance(attributeResourceId, R.string.wizard_help_step1_title, R.string.activity_wizard_help_step1_line2, attributeStepsId);
            }
            break;
        default:
            break;
        }
    } catch (Exception e) {
        e.printStackTrace();
        new SendEmailAsyncTask(getApplicationContext(), getClass().getName(),"getItem(int position)", e).execute();
    }

    return fragment;
}

/* (non-Javadoc)
 * @see android.support.v4.view.PagerAdapter#getCount()
 */
@Override
public int getCount() {
    return 4;
}

}
Community
  • 1
  • 1
  • 3
    Hint from the question you linked: "Examine your `getItem(int index)` method very closely and look for any logic, scenarios or missing 'break' statements which might cause you to end up with a null fragment." On exception you're returning nulls. – laalto Jun 10 '16 at 07:20
  • @jankigadhiya there is no such class you specified. – Divyang Pathak Jun 20 '16 at 14:13

1 Answers1

0

use

try {
    // you full code here
} catch (NullPointerException n){
    Toast.makeText(getApplicationContext(),n.toString(),Toast.LENGTH.LONG).show();
}

this will show you the full detail of exception. Hope this will help you to reach at the error.

Teerath Kumar
  • 488
  • 5
  • 15
  • Thanks Teerath, but I have already implemented a code which sends a stacktrace email to me in the catch block. One more thing, I would like add here is, it not frequent, it is like I am keeping the application open for 6-7 hours and then navigating to the screen wherein these fragment adapter is set for showing the Help Wizard screen and the application crashes with NullPointerException. – Divyang Pathak Jun 10 '16 at 08:11