title: Calling a javascript function from java method in Cordova
body: <p>I made a plugin for communication between javascript and native java code.But due to some reason i had to return to callback immediately. And in turn,I started an asynchronous method in java.Now after it completes implementation,I want to return back to my javascript.Please tell me how to do it.</p>
  
  <p>My java code is-</p>
  
  <pre><code>public class MyPlugin extends CordovaPlugin
  {
      String fileName;
      Context context;
      @Override
      public void initialize(CordovaInterface cordova, CordovaWebView webView) {
          super.initialize(cordova, webView);
          // your init code here
      }
  
       @Override
       public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException 
       {
              context=this.cordova.getActivity().getApplicationContext();
              String myurl = args.getString(0);
              if (action.equals("plugin1"))
              { 
  
                     new DownloadManager().execute(myurl);
  
                      callbackContext.success("Operation performed successfully!!");
                      return true;
               }
  
  
              callbackContext.error("error");
              return false;
  
       }
  
       public class DownloadManager extends AsyncTask&lt;String, String, String&gt; {
  
          @Override
          public String doInBackground(String... arg0) {
              downloadapk(arg0[0]);
              installapk();
              System.out.println("Download Complete");
              return null;
  //Here I want to return to javascript.How can I callback to the javascript function from //async method?? 
          }
  
       }
  </code></pre>