Q:

Why does Input from an AlertDialog not show in RecyclerView?

I want to take input from an AlertDialog box and set it to 2 variables then use those variables as an argument to make a list using recyclerview.
With the code in its this state it brings up the dialogbox and when i enter information and press "add" nothing shows onto the screen.
Here is my Java file:
public class tab1Expenses extends Fragment {
List<ExRow> expenseList = new ArrayList<>();
RecyclerView recyclerView;
ExpensesAdapter mAdapter;
Button btnEx;
EditText txtExName;
EditText txtExAmount;

public void expenseData() {

    ExRow exs = new ExRow(txtExNa, txtExAm);
    expenseList.add(exs);

    mAdapter.notifyDataSetChanged();

}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.tab1expense, container, false);
    btnEx = (Button) rootView.findViewById(R.id.btnEx);
    recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);

    mAdapter = new ExpensesAdapter(expenseList);
    RecyclerView.LayoutManager mLayoutManager = new RecyclerView.LayoutManager() {
        @Override
        public RecyclerView.LayoutParams generateDefaultLayoutParams() {

            return null;
        }

    };
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setAdapter(mAdapter);

    btnEx.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            View view = LayoutInflater.from(tab1Expenses.this.getActivity())
                    .inflate(R.layout.add_ex, null);
            txtExName = (EditText) view.findViewById(R.id.exName);
            txtExAmount = (EditText) view.findViewById(R.id.exAmount);
            AlertDialog.Builder add = new AlertDialog.Builder(tab1Expenses.this.getActivity());
                    add.setCancelable(true)
                    .setTitle("Enter Expense:")
                    .setView(view)
                    .setPositiveButton("Add",
                            new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    expenseData();
                                }
                            });
            Dialog dialog = add.create();
            dialog.show();
        }
    });

    return rootView;
   }
}

Here is the related XML file:
<Button
    android:text="Add Expense"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/btnEx"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:width="800dp"
    android:textAppearance="@style/TextAppearance.AppCompat.Widget.Switch"
    android:background="@android:color/black"
    android:textColor="@android:color/holo_green_light"
    android:textColorLink="@android:color/holo_green_light" />

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentStart="true"
    android:layout_marginBottom="17dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical" />

    </LinearLayout>

</ScrollView>

And the XML file for adding inputs:
 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/background_light">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:ems="10"
        android:id="@+id/exName"
        android:textColorLink="@android:color/holo_green_light"
        android:textColorHighlight="@android:color/holo_green_light"
        android:editable="false"
        android:hint="Expense Name" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:ems="10"
        android:id="@+id/exAmount"
        android:textColorLink="@android:color/holo_green_light"
        android:textColorHighlight="@android:color/holo_green_light"
        android:hint="Expense Amount" />

</LinearLayout>

A:

You need to get the reference for txtExName and txtExAmount from view not rootview. So from your latest code remove these lines 
txtExName = (EditText) rootView.findViewById(R.id.exName); 
txtExAmount = (EditText) rootView.findViewById(R.id.exAmount); 

and add these lines on same spot.
txtExName = (EditText) view.findViewById(R.id.exName); 
txtExAmount = (EditText) view.findViewById(R.id.exAmount); 

