title: enable edit box only after selecting the radio button
body: <p>I have two radio buttons i.e., call and email. When call is selected then the edit box should get enabled and then user may enter the mobile number.
  I've checked these links:
  <a href="https://stackoverflow.com/questions/21752408/enable-a-text-box-only-when-1-of-the-radio-button-is-clicked">Enable a text box only when 1 of the radio button is clicked</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10131827/enable-text-box-based-on-radio-button-selected">Enable text box based on radio button selected</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1459627/making-text-box-not-editable">Making Text box not editable</a></p>
  
  <p>but am not able to achieve this task.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>     &lt;LinearLayout 
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_marginRight="10dp"
       android:layout_marginLeft="10dp"
       android:layout_marginTop="10dp"  &gt;
  
              &lt;RadioGroup
              android:id="@+id/radioGroup1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:weightSum="2" 
              android:orientation="horizontal"&gt;
  
               &lt;RadioButton
               android:id="@+id/radio0"
               android:layout_width="0dp"
               android:layout_height="wrap_content" 
               android:layout_weight="1"
               android:text="@string/call"/&gt;
  
               &lt;RadioButton
               android:id="@+id/radio1"
               android:layout_width="0dp"
               android:layout_height="wrap_content"
               android:text="@string/email"
               android:layout_weight="1" /&gt;
               &lt;/RadioGroup&gt;
               &lt;/LinearLayout&gt;
  
      &lt;LinearLayout 
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_marginRight="10dp"
       android:layout_marginLeft="10dp"
       android:layout_marginTop="10dp"
       android:weightSum="1"&gt;
  
      &lt;TextView
          android:id="@+id/textView21"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:text="@string/mobile"
          android:textColor="#000000"
          android:textSize="15sp"
          android:layout_weight="0.3" /&gt;
  
      &lt;EditText
          android:id="@+id/editText1"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:ems="10"
          android:inputType="numberDecimal"
          android:maxLength="10"
          android:layout_weight="0.7"
          android:inputType="none" /&gt;
      &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>.java</p>
  
  <pre><code>public class MainActivity extends Activity {
  String mobile;
  
  RadioGroup rg1 = (RadioGroup) findViewById(R.id.radioGroup1);
  EditText edit = (EditText) findViewById(R.id.editText1);
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      edit.setEnabled(false);
      edit.setInputType(InputType.TYPE_NULL);
      edit.setFocusable(false);
  
      rg1.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  
          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
              switch (checkedId) {
              case R.id.radio0:   
                  op1="call";
                  actv(); 
                  break;
  
              case R.id.radio1:
                  op1="email";
                  break;
  
              }   
  
          }
      });
  
      public void actv() {
      edit.setEnabled(true);
          edit.setInputType(InputType.TYPE_CLASS_TEXT);
          edit.setFocusable(true);
      }
  </code></pre>