title: How to programmatically set and remove Focus on edit text on click of a button
body: <p>I have one edit text and i want to set focus on it once a button is clicked and after editing my status when enter or done is pressed for soft keyboard i want to remove focus again and send a request to server.</p>
  
  <p>here is my edit text in XML</p>
  
  <pre><code>&lt;EditText
                  android:id="@+id/time_statusTV"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignBottom="@+id/selectIBT"
                  android:layout_alignLeft="@+id/profile_name"
                  android:layout_toLeftOf="@+id/add_timeline_status_IBTN"
                  android:layout_toRightOf="@+id/image_profile"
                  android:background="@android:color/transparent"
                  android:focusable="false"
                  android:maxLines="2"
                  android:text="short description of \nyourself that can go\nover 2 lines."
                  android:textColor="@color/text_color_gray"
                  android:textSize="18sp" /&gt;
  </code></pre>
  
  <p>here what i am doing on button click</p>
  
  <pre><code>case R.id.add_timeline_status_IBTN:
          time_statusTV.setFocusable(true);
          time_statusTV.requestFocus();
  
          break;
  </code></pre>
  
  <p>here is my Edit text key event </p>
  
  <pre><code>time_statusTV = (EditText) rootView.findViewById(R.id.time_statusTV);
      time_statusTV.setOnKeyListener(new OnKeyListener() {
  
          @Override
          public boolean onKey(View v, int keyCode, KeyEvent event) {
              // TODO Auto-generated method stub
              if ((event.getAction() == KeyEvent.ACTION_DOWN)
                      &amp;&amp; (keyCode == KeyEvent.KEYCODE_ENTER)) {
  
                  // My code
  
                  time_statusTV.clearFocus();
              }
              return false;
          }
      });
  </code></pre>
  
  <p>But when I click on button nothing happens.</p>