title: ClassNotFoundException during Dynamic Class loading in android
body: <p>I am creating an app, where i am supposed to receive data through web service.</p>
  
  <p>Here i am having a class, stored in the main package. I need to load data of this class dynamically i.e at run time, whenever something is received from the web service. But i am getting excepion of classNotFound.</p>
  
  <p>Here is my code for dynamic loading of class,</p>
  
  <pre><code>try
  {
      Class myClass = ClassLoader.getSystemClassLoader().loadClass("com.myPackage.it.ClassToLoad");
      Log.d("Dynamic class Loading", "1");
      Object DPMInstance = myClass.newInstance();
      Toast.makeText(getApplicationContext(), 
            "Get Methods" + myClass.getMethods(), 5000).show();
      Method myMethod = myClass.getMethod("sayHello", new Class[] {});      
      myMethod.invoke(DPMInstance, new Object[] { }); 
  }
  catch(Exception e)
  {
      Log.d("Error", "" + e);
  }
  </code></pre>
  
  <p>I am getting excpetion at this line,</p>
  
  <pre><code>Class myClass = ClassLoader.getSystemClassLoader().loadClass("com.myPackage.it.ClassToLoad");
  </code></pre>