I am sending the arraylist from one fragment to the another by using the interface.but when i make the instance of the interface it gives class cast exception.can anyone tell me what i am doing wrong ??

This is my interface:-

```
public class SaleFragment extends UpdatableFragment  {

  private SendArrayList mSendArrayList;

  public interface SendArrayList {

            public void sendData(ArrayList<String> listCustomer);

        }
    }

```

And this is the code where i am making the instance of the interface and add the arraylist to it :-

```
 @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        mSendArrayList = (SendArrayList)getActivity();

        dbh = new DatabaseHandler(getContext());

        Cursor cursor = dbh.getAllCustomer();
        if (cursor.moveToFirst()) {
            do {
                String customerName = cursor.getString(0);
                mListCustomerName.add(customerName);

            } while (cursor.moveToNext());
        }

        mSendArrayList.sendData(mListCustomerName);

    }

```

at this line " mSendArrayList = (SendArrayList)getActivity();" gives class cast exception can anyone tell me how can i use the interface for send the data from one fragment to the another.