title: Auto-Complete adapter size gets reduced to zero
body: <p>I have a Main activity which have some tabs each displaying a fragment,among them one is camera fragment in which after capturing an image from camera, a popup appear in which there is an autocompletetextview named lure and a submit button.</p>
  
  <p>The autocompletetextview(lure) adapter is set and its size is printed in dialog popup window, which is same as expected like 15.</p>
  
  <p>The problem is that when i click on the submit button of popup dialog, its size automatically get to 0, and i want the actual size, which is 15.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Camera_fragment extends Fragment {
      private AutoCompleteTextView lure;
  
      private ArrayList&lt;String&gt; lureArrayList
      private ArrayAdapter&lt;String&gt; adapterLure;
      Dialog layout;
      View view;
  
      public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) {
          view= inflater.inflate(
          R.layout.camera, container, false);
          return view;
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onActivityCreated(savedInstanceState);
          global=(GlobalData)getActivity().getApplicationContext();
          layout = new Dialog(getActivity());
          getrefrence();
          arrayListDataFetchDB();
          newImage.setOnClickListener(new View.OnClickListener()
          {
              @Override
              public void onClick(View arg0)
              {
                  Intent in= new Intent(getActivity(),com.camera.CameraCall.class);
                  startActivityForResult(in, CAPTURE_IMAGE);
              }
          });
          newImage.performClick();
      }
  
      private void getrefrence()
      {
          newImage=(Button)view.findViewById(R.id.newCapture);
      }
  
      private void arrayListDataFetchDB()
      {
          lureArrayList=database.select("Select Lure_USED  From LURE Group By Lure_USED Order By COUNT(Lure_USED) DESC");
      }
  
      private void adapterset()
      {
          adapterLure = new ArrayAdapter&lt;String&gt;(getActivity(), android.R.layout.simple_dropdown_item_1line, lureArrayList);
          lure.setAdapter(adapterLure);
      }
  
      private void initiatePopupWindow()
      {
  
          //layout.requestWindowFeature(layout.getWindow().FEATURE_NO_TITLE);
          layout.setContentView(R.layout.after_catch_fish_popup_form);
          Display display = getActivity().getWindowManager().getDefaultDisplay();
          int mwidth = display.getWidth();
          WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
          lp.copyFrom(layout.getWindow().getAttributes());
          lp.width = mwidth;
          layout.getWindow().setAttributes(lp);
          layout.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
          layout.show();
          lure=(AutoCompleteTextView)layout.findViewById(R.id.lure);
          Button submit=(Button)layout.findViewById(R.id.done);
          adapterset();
          lure.setThreshold(1);
          Log.v("adapterSize",""+adapterLure.getCount());
          submit.setOnClickListener(new View.OnClickListener()
          {
              @Override
              public void onClick(View v)
              {
                  Log.v("adapterSize1",""+adapterLure.getCount());
              }
          });
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data)
      {
          initiatePopupWindow();
  
      }
  
  }
  </code></pre>