title: How to set the number of lines for an EditText from alertDialog
body: <p>I need to set the number of lines to 1 for the EditText from alertDialog. I put input.setLines(1) but it doesn't work. It let me enter more than one line and I see only the last one. So, what is the solution for this?</p>
  
  <p>This is my code :</p>
  
  <pre><code>final AlertDialog.Builder alert = new AlertDialog.Builder(this);
  alert.setTitle(data);
          final EditText input = new EditText(this);
          InputFilter[] FilterArray = new InputFilter[1];
          FilterArray[0] = new InputFilter.LengthFilter(25);
          input.setFilters(FilterArray);
          input.setLines(1);
          input.postDelayed(new Runnable() {
              @Override
              public void run() {
                  InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                  keyboard.showSoftInput(input, 0);
              }
          }, 200);
  
          alert.setView(input);
  </code></pre>