title: Constructor undefined in custom adapter
body: <p>I made a custom adapter following this tutorial here:</p>
  
  <p><a href="http://www.ezzylearning.com/tutorial.aspx?tid=1763429" rel="nofollow">http://www.ezzylearning.com/tutorial.aspx?tid=1763429</a></p>
  
  <p>I changed my custom adapter to match my classes and need to look like this:</p>
  
  <p>package com.example.beerportfoliopro;</p>
  
  <pre><code>public class BeerSearchAdapter extends ArrayAdapter&lt;BeerData&gt;{
  
      Context context; 
      int layoutResourceId;    
      BeerData data[] = null;
  
      public BeerSearchAdapter(Context context, int layoutResourceId, BeerData[] data) {
          super(context, layoutResourceId, data);
          this.layoutResourceId = layoutResourceId;
          this.context = context;
          this.data = data;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row = convertView;
          beerHolder holder = null;
  
          if(row == null)
          {
              LayoutInflater inflater = ((Activity)context).getLayoutInflater();
              row = inflater.inflate(layoutResourceId, parent, false);
  
              holder = new beerHolder();
              holder.txtBrewery = (TextView)row.findViewById(R.id.beerBreweryNameList);
              holder.txtTitle = (TextView)row.findViewById(R.id.beerNameList);
  
              row.setTag(holder);
          }
          else
          {
              holder = (beerHolder)row.getTag();
          }
  
          BeerData beer = data[position];
          holder.txtTitle.setText(beer.beerName);
          holder.txtBrewery.setText(beer.beerBreweryName);
  
          return row;
      }
  
      static class beerHolder
      {
          TextView txtBrewery;
          TextView txtTitle;
      }
  }
  </code></pre>
  
  <p>The error I am getting when I try and call my adapter is:</p>
  
  <pre><code>The constructor BeerSearchAdapter(Search, int, List&lt;BeerData&gt;) is undefined
  </code></pre>
  
  <p>I am calling the adapter with:</p>
  
  <pre><code>//update listview
  BeerSearchAdapter adapter1 = new BeerSearchAdapter(Search.this ,R.layout.listview_item_row, beerList);
  lv.setAdapter(adapter1);
  </code></pre>
  
  <p>My full Search.java is:</p>
  
  <p>package com.example.beerportfoliopro;</p>
  
  <pre><code>public class Search extends Activity implements OnQueryTextListener {
  
  private ListView lv;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Log.d("logIN", "starting activity");
          setContentView(R.layout.activity_search);
  
  
      }
  
      @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);
  
          SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
          searchView.setOnQueryTextListener(this);
          return true;
      }
  
      //get entered search and pop up a toast to show query entered
      public boolean onQueryTextSubmit (String query) {
  
          //toast query 
          Toast.makeText(this, "Searching for: " + query + "...", Toast.LENGTH_SHORT).show();
  
          //make json variables to fill
  
          // url to make request
          String url = "http://api.brewerydb.com/v2/search?key=myKey&amp;format=json&amp;type=beer&amp;withBreweries=y&amp;q=";
  
  
  
          try {
              query = URLEncoder.encode(query, "UTF-8");
          } catch (UnsupportedEncodingException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
          String jsonUrl = url + query;
  
  
  
          //todo: get json 
          new ReadJSONResult().execute(jsonUrl);
  
          return false;
      }
  
      private class ReadJSONResult extends AsyncTask
      &lt;String, Void, String&gt; {
          protected String doInBackground(String... urls) {
              return readJSONFeed(urls[0]);
          }
  
          protected void onPostExecute(String result) {
              try {
  
                  //start progress bar
                  //requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);  
                  //setProgressBarIndeterminateVisibility(true);
  
  
                  ///get 
  
  
                  JSONObject json = new JSONObject(result);
  
                  //acces listview
                  lv = (ListView) findViewById(android.R.id.list);
  
                  //make array list for beer
                  final List&lt;BeerData&gt; beerList = new ArrayList&lt;BeerData&gt;();
  
  
  
                  //get json items
                  for(int i = 0; i &lt; json.getJSONArray("data").length(); i++) {
  
                      String beerId = GetBeerDataFromJSON(i,"id", json);
                      String beerName = GetBeerDataFromJSON(i,"name", json);
                      String beerDescription = GetBeerDataFromJSON(i,"description" , json);
                      String beerAbv = GetBeerDataFromJSON(i,"abv" , json);
                      String beerIbu = GetBeerDataFromJSON(i,"ibu" , json);
                      String beerIcon = GetBeerIconsFromJSON(i, "icon",json );
                      String beerMediumIcon = GetBeerIconsFromJSON(i, "medium",json );
                      String beerLargeIcon = GetBeerIconsFromJSON(i, "large",json );
                      String beerGlass = GetBeerGlassFromJSON(i, json );
                      String beerStyle = GetBeerStyleFromJSON(i,"name", json );
                      String beerStyleDescription = GetBeerStyleFromJSON(i,"description", json );
                      String beerBreweryId = GetBeerBreweryInfoFromJSON(i, "id", json );
                      String beerBreweryName = GetBeerBreweryInfoFromJSON(i, "name", json );
                      String beerBreweryDescription = GetBeerBreweryInfoFromJSON(i, "description", json );
                      String beerBreweryWebsite = GetBeerBreweryInfoFromJSON(i, "website", json );
  
                      //get long and latt
                      String beerBreweryLat = GetBeerBreweryLocationJSON(i, "longitude", json );
                      String beerBreweryLong = GetBeerBreweryLocationJSON(i, "latitude", json );
  
                      String beerBreweryYear = GetBeerBreweryInfoFromJSON(i, "established", json );
                      String beerBreweryIcon = GetBeerBreweryIconsFromJSON(i,"large",json);
  
  
  
                      //create beer object
                      BeerData thisBeer = new BeerData(beerName, beerId, beerDescription, beerAbv, beerIbu, beerIcon,
                              beerMediumIcon,beerLargeIcon, beerGlass, beerStyle, beerStyleDescription, beerBreweryId, beerBreweryName,
                              beerBreweryDescription, beerBreweryYear, beerBreweryWebsite,beerBreweryIcon, beerBreweryLat, beerBreweryLong);
  
                      //add beer to list
                      beerList.add(thisBeer);
  
  
                  }
  
                  //update listview
                  BeerSearchAdapter adapter1 = new BeerSearchAdapter(Search.this ,R.layout.listview_item_row, beerList);
                  lv.setAdapter(adapter1);
  
  
                  //set up clicks
                  lv.setOnItemClickListener(new OnItemClickListener() {    
                         @Override
                         public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,
                                                  int arg2, long arg3) {
                                Intent i = new Intent(Search.this, BeerPage.class); 
  
                                BeerData beerInfo = beerList.get(arg2);
  
  
                                //Toast.makeText(MainActivity.this,  beerInfo.beerName, Toast.LENGTH_SHORT).show();
  
                                i.putExtra("myBeerObject",  beerInfo);   
                                i.setClass(Search.this, BeerPage.class);
  
  
                                startActivity(i); 
  
  
  
                         } 
                     });
  
                  //end progress bar
                  //setProgressBarIndeterminateVisibility(false);
  
  
  
  
  
  
              } catch (Exception e) {
                  Log.d("ReadBeerDataTask", e.getLocalizedMessage());
              }          
          }
      }
  
      private String GetBeerDataFromJSON(int position, String whatToGet, JSONObject json ) {
          String whatIsTheKeyYouAreLookFor = whatToGet;
          int whereInTheJSONArrayForLoopIsTheData = position;
          String holder = "";
          try{
              holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getString(whatIsTheKeyYouAreLookFor);
  
          } catch (JSONException e) {
              holder = "N/A";
          }
  
  
  
          return holder;
      }
  
  
      //get icons
          private String GetBeerBreweryIconsFromJSON(int position, String whatToGet, JSONObject json ) {
              String whatIsTheKeyYouAreLookFor = whatToGet;
              int whereInTheJSONArrayForLoopIsTheData = position;
              String holder = "";
              try{
                  holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONArray("breweries").getJSONObject(0).getJSONObject("images").getString(whatIsTheKeyYouAreLookFor);;
              } catch (JSONException e) {
                  holder = "N/A";
              }
  
  
  
              return holder;
          }
  
      //get icons
      private String GetBeerIconsFromJSON(int position, String whatToGet, JSONObject json ) {
          String whatIsTheKeyYouAreLookFor = whatToGet;
          int whereInTheJSONArrayForLoopIsTheData = position;
          String holder = "";
          try{
              holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONObject("labels").getString(whatIsTheKeyYouAreLookFor);
  
          } catch (JSONException e) {
              holder = "N/A";
          }
  
  
  
          return holder;
      }
  
      //get style information
          private String GetBeerStyleFromJSON(int position, String whatToGet, JSONObject json ) {
              String whatIsTheKeyYouAreLookFor = whatToGet;
              int whereInTheJSONArrayForLoopIsTheData = position;
              String holder = "";
              try{
                  holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONObject("style").getString(whatIsTheKeyYouAreLookFor);
  
              } catch (JSONException e) {
                  holder = "N/A";
              }
  
  
  
              return holder;
          }
  
          //get location data
          private String GetBeerBreweryLocationJSON(int position, String whatToGet, JSONObject json ) {
              String whatIsTheKeyYouAreLookFor = whatToGet;
              int whereInTheJSONArrayForLoopIsTheData = position;
              String holder = "";
              try{
                  holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONArray("breweries").getJSONObject(0).getJSONArray("locations").getJSONObject(0).getString(whatIsTheKeyYouAreLookFor);
  
              } catch (JSONException e) {
                  holder = "N/A";
              }
  
  
  
              return holder;
          }
  
      //get brewery information
          //get style information
                  private String GetBeerBreweryInfoFromJSON(int position, String whatToGet, JSONObject json ) {
                      String whatIsTheKeyYouAreLookFor = whatToGet;
                      int whereInTheJSONArrayForLoopIsTheData = position;
                      String holder = "";
                      try{
                          holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONArray("breweries").getJSONObject(0).getString(whatIsTheKeyYouAreLookFor);
  
                      } catch (JSONException e) {
                          holder = "N/A";
                      }
  
  
  
                      return holder;
                  }
  
      //get glass
      private String GetBeerGlassFromJSON(int position, JSONObject json ) {
  
          int whereInTheJSONArrayForLoopIsTheData = position;
          String holder = "";
          try{
              holder = json.getJSONArray("data").getJSONObject(whereInTheJSONArrayForLoopIsTheData).getJSONObject("glass").getString("name");
  
          } catch (JSONException e) {
              holder = "N/A";
          }
  
  
  
          return holder;
      }
  
  
      //gets the json from the inputed url
      public String readJSONFeed(String URL) {
          StringBuilder stringBuilder = new StringBuilder();
          HttpClient httpClient = new DefaultHttpClient();
          HttpGet httpGet = new HttpGet(URL);
          try {
              HttpResponse response = httpClient.execute(httpGet);
              StatusLine statusLine = response.getStatusLine();
              int statusCode = statusLine.getStatusCode();
              if (statusCode == 200) {
                  HttpEntity entity = response.getEntity();
                  InputStream inputStream = entity.getContent();
                  BufferedReader reader = new BufferedReader(
                          new InputStreamReader(inputStream));
                  String line;
                  while ((line = reader.readLine()) != null) {
                      stringBuilder.append(line);
                  }
                  inputStream.close();
              } else {
                  Log.d("JSON", "Failed to download file");
              }
          } catch (Exception e) {
              Log.d("readJSONFeed", e.getLocalizedMessage());
          }        
          return stringBuilder.toString();
      }
  
  
      @Override
      public boolean onQueryTextChange(String newText) {
          // TODO Auto-generated method stub
          return false;
      }
  
  
  
  
  }
  </code></pre>