title: Dialog shows twice
body: <p>I'm making an dialog box on my <code>EditText</code>, so when I touch the <code>EditText</code>, the box will show (setOntouchListener). The problem is: when I touch the <code>EditText</code>, the box is shown twice (when I click dismiss button in the box, the second box shows and the content of the box is exactly the same)</p>
  
  <pre><code>FoodText.setOnTouchListener(new OnTouchListener() {
      @Override           
      public boolean onTouch(View arg0, MotionEvent arg1) {
  
          final Dialog dialog = new Dialog(context);
          dialog.setContentView(R.layout.customfoodinput);
          dialog.setTitle("Insert your Food");
  
          spinner1 = (Spinner) dialog.findViewById(R.id.spinner_foodTime);            
          spinner2 = (Spinner) dialog.findViewById(R.id.spinner_foodType);
  
          foodtimeArray.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spinner1.setAdapter(foodtimeArray);
  
          foodtypeArray.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spinner2.setAdapter(foodtypeArray);
  
          Button btntampung = (Button) dialog.findViewById(R.id.btn_inputfood);
  
          btntampung.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
                  Object item = spinner1.getSelectedItem();
                  String dataspinner = item.toString();
  
                  Object item2 = spinner2.getSelectedItem();
                  String dataspinner2 = item2.toString();
  
                  dialog.dismiss();
                  FoodText.setText(dataspinner + "; " + dataspinner2);
  
              }
          });
  
          dialog.show();
  
          return false;           
      }
  });
  </code></pre>
  
  <p>Anyone could help me?</p>