title: Dynamic Class casting
body: <p>I'm having a problem with casting in Android.</p>
  
  <p>I'm developing an App that handle multiple devices, and i'm trying to make a dynamic class alocation (i.e, User sets the device and the app instanciate the class according to the user settings)</p>
  
  <p>Here is a Sample code:</p>
  
  <pre><code>String Usr_imput; //name of the class
  Class class = Class.forName(Usr_Input);
  Object o = class.newInstance();
  </code></pre>
  
  <p>with that I can't access methods from the Usr_Input Class. The method class.cast(o) should be the solution to my problems but I can't get it to work, does the cast statement stacks?</p>
  
  <p>Isn't it suposed to work if I use:</p>
  
  <pre><code>class.cast(o);
  o.Method();
  </code></pre>
  
  <p>Anyone has experience on that?</p>