title: open an epub file from android app
body: <p>I am trying to open an epub file from my android app using Moon Reader. Code given below. I am getting an error in the log as follows: 
  11-26 16:57:01.237: E/Web Console(12254): Uncaught Error: Error calling method on NPObject.:5914</p>
  
  <p>Please can you advise what can be the issue?</p>
  
  <pre><code>public void openEpub(String url)
  {
      Intent intent = null;
      Uri uri = null;
      try {
          intent = new Intent(Intent.ACTION_VIEW);
          uri = Uri.parse(url);
          intent.setDataAndType(uri, "application/epub+zip");
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  
      try {
          //startActivity(intent);
          PackageManager pm = getPackageManager();
          try
          {
              String packageName = "com.flyersoft.moonreader";
              Intent launchIntent = pm.getLaunchIntentForPackage(packageName);
              launchIntent.setAction(Intent.ACTION_VIEW);
              launchIntent.setData(uri);
              startActivity(launchIntent);
          }
          catch (Exception e1)
          {
              e1.printStackTrace();
          }
          catch (Error e2) {
              e2.printStackTrace();
          }
      } catch (ActivityNotFoundException e) {
          // No application to view, ask to download one
          AlertDialog.Builder builder = new AlertDialog.Builder(this);
          builder.setTitle("No Application Found");
          builder.setMessage("Download one from Android Market?");
          builder.setPositiveButton("Yes, Please",
                  new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          Intent marketIntent = new Intent(Intent.ACTION_VIEW);
                          marketIntent.setData(Uri.parse("market://search?q=epub&amp;c=apps"));
                          startActivity(marketIntent);
                      }
                  });
          builder.setNegativeButton("No, Thanks", null);
          builder.create().show();
      }
      catch(Error e3) {
          e3.printStackTrace();
      }
  }
  </code></pre>