This is my code

```
public class OrderAllFragment extends ListFragment {
    private ArrayList<Order> orders1;
    private ArrayList<String> orders;
    private ListView orderListView;
    public OrderAllFragment() {

        orders1 = new ArrayList<>();
        orders = new ArrayList<>();
        for (int i=0; i<10; ++i){
            Order o = new Order(i, 1+10);
            orders1.add(o);
            orders.add("dummy" + i);
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        OrderAdapter adapter = new OrderAdapter (getActivity(), orders1);
        orderListView = (ListView) getActivity().findViewById(R.id.listViewOrder);
        orderListView.setAdapter(adapter);

        //ListAdapter listAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, orders);
        //setListAdapter(listAdapter);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_all_order, container, false);
    }

    @Override
    public void onListItemClick(ListView list, View v, int position, long id) {

        Toast.makeText(getActivity(), getListView().getItemAtPosition(position).toString(), Toast.LENGTH_LONG).show();
    }
}

```

It works fine for string. That is.

```
//ListAdapter listAdapter = new ArrayAdapter<String>(getActivity(),             android.R.layout.simple_list_item_1, orders);
//setListAdapter(listAdapter);

```

But this line gives Null Pointer exception.

```
 orderListView.setAdapter(adapter);

```

This is XML file.

```
    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingLeft="30dip"
        android:layout_marginTop="50dp"
        />

    <ListView
        android:id="@+id/listViewOrder"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingLeft="30dip"
        android:layout_marginTop="50dp"
        />

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="Design Games Screen"
        android:textSize="20dp"
        android:layout_centerInParent="true"/>

</RelativeLayout>

```

Can somebody help me on what i am doing wrong?