title: How to open password protected pdf file by providing password in android application programmatically
body: <p>I am developing a pdf reader, as android don't have any native pdf viewer so i have to use third party pdf viewer. in that case i have chose the Adobe pdf viewer for android. I can open pdf file which are stored in sdcard of my device. Now i want to open password protected pdf file from my application. If user wants to open password protected pdf file manually then use have to provide password while opening. but i want to open those password pdf file from my application without any password prompt. Application provide the password,[apps knows the password] and without any password prompt, pdf will open.</p>
  <p>currently if i want to open any password protected pdf file from my application then a password prompt is appeared and needs a password to open it.</p>
  <p>I am using this code to open pdf from my stored pdf files in the /mnt/sdcard/testfolder</p>
  <h2>Here is the code</h2>
  <pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {
          super.onListItemClick(l, v, position, id);
          PackageManager packageManager = getPackageManager();
          Intent testIntent = new Intent(Intent.ACTION_VIEW);
          testIntent.setType(&quot;application/pdf&quot;);
          List list = packageManager.queryIntentActivities(testIntent,
                  PackageManager.MATCH_DEFAULT_ONLY);
          if (list.size() &gt; 0 &amp;&amp; imagelist[(int) id].isFile()) {
              Intent intent = new Intent();
              intent.setAction(Intent.ACTION_VIEW);
              Uri uri = Uri.fromFile(imagelist[(int) id].getAbsoluteFile());
              intent.setDataAndType(uri, &quot;application/pdf&quot;);
              startActivity(intent);
          }
      }
  </code></pre>
  <p>How to open password protected pdf file by providing password in android application programmatically.PLEASE HELP :(</p>