cadgis

Auto Complete Attribute Query

Discussion created by cadgis on Nov 11, 2013
Latest reply on Nov 25, 2013 by tmsbn90
Hi

I am working on a landmark(point)  feature layer. I query this layer with a WhereClause so that it brings a single value (name)  from the attributes of each feature. I put this featureset into a  graphics array.

On postexecute,  I get the attribute value from the graphics array  and put it in an adapter. This data adapter is set to an  autocomplete text view. When the user key in any 2  letters,  the attribute values that 'contain' these letters display as drop down so that the user can select and query again for the location to see it in the map.

Everything is working fine except that not all the data that "contains" these letters are displayed but only few. It seems there is a limit  set some where. how can i over come this? Any Idea? Please?

Here is the Code.


private class RunQueryForArray extends AsyncTask<String, Void, Graphic[]>{
 @Override
 protected void onPreExecute() {
     progress = ProgressDialog.show(SearchLandmarkActivity.this, "Landmark Search","Please wait....");
  }
 @Override
 protected Graphic[] doInBackground(String... params) {
  // TODO Auto-generated method stub
  String WhereClause = "NAME <> '0'" ;
  Query query = new Query();
  query.setWhere(WhereClause);
  query.setReturnGeometry(true);
  query.setOutFields(new String[] {"NAME"});
  
  QueryTask qTask = new QueryTask(featureServiceURL);
  FeatureSet fs = null;
 try{ 
  fs = qTask.execute(query);
  Graphic[] grs = fs.getGraphics();
   return grs;
  }
      catch(Exception e) {
   e.printStackTrace(); 
  }
  return null;
 }
 @Override
 protected void onPostExecute(Graphic[] graphics) {
  List<String> mArray = new ArrayList<String>();
 for (Graphic gr : graphics) {
   String mName = (String)gr.getAttributeValue("NAME");
   mArray.add(mName);
         }
       progress.dismiss();
       ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_dropdown_item_1line, mArray);
    AcTv.setThreshold(2);
      AcTv.setAdapter(adapter);
   }
      }  



Outcomes