title: Cast Class object to EditText in Android?
body: <pre><code>public void changeCurrency(RelativeLayout layout) {
      for (int i = 0; i &lt; layout.getChildCount(); i++) {
          View v = layout.getChildAt(i);
          Class c = v.getClass();
          if (c == EditText.class) {
              // validate EditClass
          } else if (c == TextView.class) {
              //validate RadioButton
          } 
      }
  }
  </code></pre>
  
  <p>In the above code I'm trying to iterate through gui elements in a layout and validate their contents. I'm struggling at the commented parts. </p>
  
  <p>I.e. getting access to the EditText's text value..</p>
  
  <p>I can't figure out how to cast the c object to a EditText to check the values.</p>
  
  <p>Ideas?</p>