Stack Exchange
OnClick button navigates to dashboard instead of new fragment
I have a device specific issue in my android application. image icon onclick a new fragment should get loaded but instead it navigates to Dashboard. It is working fine on all the other devices except Samsung duos devices.
@Override
public void onClick(View v)
{
    switch (v.getId())
    {
        case R.id.add_deal:
            Intent addDealIntent = new Intent(mContext, BaseFragmentActivity.class);
            addDealIntent.putExtra("Merchant", merchantInfo);
            addDealIntent.putExtra("FragmentClassName", AddDealFragment.class.getName());
            addDealIntent.putExtra("toolbarTitle", "Add Deal");
            mContext.startActivity(addDealIntent);
            break;
        case R.id.add_product:
            Intent addProductIntent = new Intent(mContext, BaseFragmentActivity.class);
            addProductIntent.putExtra("Merchant", merchantInfo);
            addProductIntent.putExtra("Categories", mMerchantCategories);
            addProductIntent.putExtra("SubCategories", mMerchantSubCategories);
            addProductIntent.putExtra("SubSubCategories", mMerchantSubSubCategories);
            addProductIntent.putExtra("SuperSubCategories", mMerchantSuperSubCategories);
            addProductIntent.putExtra("FragmentClassName", AddProductFragment.class.getName());
            addProductIntent.putExtra("toolbarTitle", "Add Product");
            mContext.startActivity(addProductIntent);
            break;
        case R.id.dialog_button_cancel:
            dismiss();
            break;
        default:
            break;
    }
     dismiss();
}


Please edit your question and wrap all that inside the code tag. use  

need some more explanation. is it working fine rest devices ? your xml layout structure.

Yes it is working absolutely fine on all the other devices except Samsung duos devices.

With startActivity method you can only navigate between activitis then you must change fragment. 
You can use this code to change your fragments :  
// Create new fragment and transaction
Fragment newFragment = new ExampleFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();

// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack if needed
transaction.replace(R.id.fragment_container, newFragment);
transaction.addToBackStack(null);

// Commit the transaction
transaction.commit();


I tried using this solution but the still same problem is occuring

I tried the code but then it still navigates to the same page
