title: forwarding Intent?
body: <p>for example k9-Mail will try to find a application to handle some attachments and uses the MimeType-Specification of the email.</p>
  
  <p>For example with PDF it sends correct (debugging information):</p>
  
  <pre><code>12-27 15:41:58.992: I/ActivityManager(119): Starting: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/3/VIEW typ=application/pdf flg=0x3880001 cmp=com.adobe.reader/.AdobeReader } from pid 119
  </code></pre>
  
  <p>But if the mail attach the PDF not with MimeType "application/pdf" but with "'application/pdf'" it does not work. :-( This results in the broadcast:</p>
  
  <pre><code>12-27 15:35:15.007: I/ActivityManager(119): Starting: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/2/VIEW typ='application/pdf' flg=0x80001 } from pid 3635
  </code></pre>
  
  <p>The ' at beginning and end causes IMHO that no application is found to handle that. :-(</p>
  
  <p>K9-Mail miss some other mappings to, so my idea was to build a little application, that catch the call and forward it. But for example the reader is not opened. I tried that:</p>
  
  <pre><code>    @Override
  protected void onPostCreate(Bundle savedInstanceState) {
      super.onPostCreate(savedInstanceState);
  
      Log.i(TAG, "Activity is called and created");
  
      mapping.put("'application/pdf'", "application/pdf");
      String type = getIntent().getType();
  
      if (mapping.containsKey(type)) {
          Log.i(TAG, "found mapping: " + type + " =&gt; " + mapping.get(type));
  
          Log.v(TAG, "Intent before: " + getIntent().toString());
          Intent i = new Intent(getIntent().getAction(), getIntent().getData());
          i.setType(mapping.get(type));
          i.setData(getIntent().getData());
          i.setFlags(getIntent().getFlags());
  
          Log.v(TAG, "Intent after: " + getIntent().toString());
          startActivity(i);
      }
  
      finish();
  }
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      Log.i(TAG, "Activity is destroyed");
  }
  </code></pre>
  
  <p>I think something with "cmd" is wrong ... because the debugger shows</p>
  
  <pre><code>12-28 08:38:51.445: V/ActivityForwardIntent(1195): Intent after: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/2/VIEW typ='application/pdf' flg=0x80001 cmp=de.blablupp.android.testproject/.ActivityForwardIntent }
  </code></pre>
  
  <p>Can someone help me? Is it possible, that the PDF-application can't get the content? But I can't see that the PDF-application is selectable or startet. :-(</p>
  
  <p>One question is also - what means cmp? And how can I set this information to the new intent?</p>
  
  <p>I hope to solve this problem, because it is really annoying to save the content and start it with file browser.</p>
  
  <p>tia and reagards</p>
  
  <p>nauni</p>