List View, Error stopped when running.(focused stopped for degug) Help me, I write code for custom listView ( extends ArrayAdapter and using ArrayList). But it doen't worked. ( Please for my English).
class : MyArrayAdapter
    package com.example.vd;

    import java.util.ArrayList;
    import android.app.Activity;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.ArrayAdapter;
    import android.widget.TextView;

    public class MyArrayAdapter extends ArrayAdapter<Product>{
     private Activity context=null;
     private int layoutId;
     private ArrayList<Product> array=null;
     public MyArrayAdapter(Activity context, int layoutId,ArrayList<Product>arremp)
    {
super(context,layoutId,arremp);
this.context=context;
this.layoutId=layoutId;
this.array=arremp;
    }
    public View getView(int pos, View view, ViewGroup viewGroup)
    {

LayoutInflater inflater=context.getLayoutInflater();
view=inflater.inflate(layoutId, null);
TextView txt=(TextView)context.findViewById(R.id.textView1);
Product pd=array.get(pos);
txt.setText(pd.toString());
return view;
    }

}

class MainActivity
 package com.example.vd;

    import java.util.ArrayList;

    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;


    public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArrayList<Product> array=new ArrayList<Product>();
ListView listView1 = (ListView) findViewById(R.id.listView1);
Product[] items = { 
new Product(1, "Milk", 21.50), 
new Product(2, "Butter", 15.99), 
new Product(3, "Yogurt", 14.90), 
new Product(4, "Toothpaste", 7.99), 
new Product(5, "Ice Cream", 10.00)}; 
array.add(items[0]);
array.add(items[1]);
array.add(items[2]);
MyArrayAdapter adapter=new MyArrayAdapter(this,R.layout.list_view,array);
listView1.setAdapter(adapter);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
    }
}

Class Product
    package com.example.vd;

    public class Product {
    private int id;
    private String name;
    private double price;

    public Product(){
super();
    }

    public Product(int id, String name, double price) {
super();
this.id = id;
this.name = name;
this.price = price;
    }

    @Override
    public String toString() {
return this.id + ". " + this.name + " [$" + this.price + "]";
    }
}

file xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.vd.MainActivity" >

<ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="17dp"
    android:layout_marginTop="50dp" >
</ListView>


file xml: list_view
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView" />
</LinearLayout>


You should change
 TextView txt=(TextView)context.findViewById(R.id.textView1);

to
 TextView txt=(TextView)view.findViewById(R.id.textView1);

in your MyArrayAdapter in getView(.....)

In MyArrayAdapter class constructor you are assigning null array to array object of ArrayList<Product>.
Means trying to call get method of ArrayList in getView method on null reference :
public MyArrayAdapter(Activity context, 
int layoutId, ArrayList<Product> arremp)
  { 
       ...
       this.array=arremp;
  }

Note: For better performance of ListView use ViewHolder class for holding views instead of inflate again. see follow tutorial :
Customizing Android ListView Items with Custom ArrayAdapter