title: How to get a button in my custom adapter for my listview to call a phone number
body: <p>I take in the addresses and information of stores and list then in a listview, by name, address, city/state and phn number. I am trying so that the system will use the phone to call a number. But, i get an activity not found exception.</p>
  
  <pre><code>            public static class MyRow
          {
              String storeName;
              String streetAdress;
              String location;
              String phn;
  
              MyRow(String str1, String str2, String str3, String str4)
              {
                  storeName = str1;
                  streetAdress = str2;
                  location = str3;
                  phn= str4;
              }
          }
  
          public static class CustomAdapter extends BaseAdapter
          {
              ArrayList&lt;MyRow&gt; specList;
              Context conty;
  
              CustomAdapter(Context c)
              {
                  conty = c;
                  specList = new ArrayList&lt;Row&gt;();
                  ArrayList&lt;String&gt; storeName = new ArrayList&lt;String&gt;();
                  ArrayList&lt;String&gt; streetAdress = new ArrayList&lt;String&gt;();
                  ArrayList&lt;String&gt; location = new ArrayList&lt;String&gt;();
                  ArrayList&lt;String&gt; phn= new ArrayList&lt;String&gt;();
                  for (int i = 0; i &lt; ar.size(); i++)
                  {
                      storeName.add(ar.get(i).get(0).toString());
                      streetAdress.add(ar.get(i).get(2).toString());
                      location.add(ar.get(i).get(3).toString() + ", " 
                      + ar.get(i).get(4).toString() + " " + ar.get(i).get(5).toString());
                      phn.add(ar.get(i).get(7).toString());
                  }
  
                  for (int i = 0; i &lt; ar.size(); i++)
                  {
                      specList.add(new MyRow(storeName.get(i), streetAdress.get(i), 
                              location.get(i), phn.get(i)));
                  }
              }       
  
              @Override
              public int getCount() {
                  // TODO Auto-generated method stub
                  return specList.size();
              }
  
              @Override
              public Object getItem(int position) {
                  // TODO Auto-generated method stub
                  return specList.get(position);
              }
  
              @Override
              public long getItemId(int position) {
                  // TODO Auto-generated method stub
                  return position;
              }
  
              @Override
              public View getView(int position, View convertView, ViewGroup parent) {
                  // TODO Auto-generated method stub
                  LayoutInflater inflater = (LayoutInflater) conty.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  final View rw = inflater.inflate(R.layout.row, parent, false);
                  TextView name = (TextView) rw.findViewById(R.id.textView1);
                  TextView adress = (TextView) rw.findViewById(R.id.textView2);
                  TextView location = (TextView) rw.findViewById(R.id.textView3);
                  TextView phn = (TextView) rw.findViewById(R.id.textView4);
                  final Row temp = specList.get(position);
                  name.setText(temp.storeName);
                  adress.setText(temp.streetAdress);
                  location.setText(temp.location);
                  phn.setText("  Phone:" + temp.phn);
                  Button call = (Button) rw.findViewById(R.id.button1);
                  call.setOnClickListener(new OnClickListener(){
  
                      @Override
                      public void onClick(View v) {
                          Intent i = new Intent(Intent.ACTION_CALL);
                          i.setData(Uri.parse(temp.country));
                          rw.getContext().startActivity(i);//I get an error here stating: Activity not found exception.
                      }
  
                  });
  
                  return rw;
              }
          }
  </code></pre>