title: android - Uncaught exception from Cordova plugin
body: <p>I am trying to use YoutubeAndroidPlayerAPI for my Cordova application. I have successfully built the project and I am able to pass data from Javascript to Java, and also am able to display a <code>Toast</code>, but I am not able to start the Youtube's activity.</p>
  
  <p>My code which is getting the exception:</p>
  
  <pre><code>private void openVideo(final String videoid) {
      Intent youtubeIntent = YouTubeStandalonePlayer.createVideoIntent((Activity) this.cordova, "myapikey", videoid);
      this.cordova.startActivityForResult(this, youtubeIntent, 0);
  }
  </code></pre>
  
  <p>From the logcat:</p>
  
  <pre><code>E/PluginManager(14974): Uncaught exception from plugin
  E/PluginManager(14974): java.lang.ClassCastException: org.apache.cordova.CordovaActivity$1 cannot be cast to android.app.Activity
  E/PluginManager(14974):         at YoutubePlugin.openVideo(YoutubePlugin.java:44)
  E/PluginManager(14974):         at YoutubePlugin.execute(YoutubePlugin.java:30)
  E/PluginManager(14974):         at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:95)
  E/PluginManager(14974):         at org.apache.cordova.PluginManager.exec(PluginManager.java:130)
  E/PluginManager(14974):         at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
  E/PluginManager(14974):         at org.apache.cordova.CordovaBridge.promptOnJsPrompt(CordovaBridge.java:135)
  E/PluginManager(14974):         at org.apache.cordova.engine.SystemWebChromeClient.onJsPrompt(SystemWebChromeClient.java:119)
  E/PluginManager(14974):         at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:580)
  E/PluginManager(14974):         at android.os.Handler.dispatchMessage(Handler.java:99)
  E/PluginManager(14974):         at android.os.Looper.loop(Looper.java:130)
  E/PluginManager(14974):         at android.app.ActivityThread.main(ActivityThread.java:3687)
  E/PluginManager(14974):         at java.lang.reflect.Method.invokeNative(Native Method)
  E/PluginManager(14974):         at java.lang.reflect.Method.invoke(Method.java:507)
  E/PluginManager(14974):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
  E/PluginManager(14974):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
  E/PluginManager(14974):         at dalvik.system.NativeStart.main(Native Method)
  D/SystemWebChromeClient(14974): : Line -1470026189 : org.apache.cordova.CordovaActivity$1
  I/Web Console(14974): org.apache.cordova.CordovaActivity$1 at :-1470026189
  </code></pre>