I have an application that generates custom file types (.sor). Inside the application, I have the function of sending email with one of these files. I also have an intent filter so that the application appears in the list of applications that can open this type of file. This allows me (sometimes) to open a file using the application directly from users' email client by phone.
However, this only works when the email arrives from the PC email client and will not work when the email is received from the phone. For example, if I create one of these .sor files, and then use my application to send email to my own email account, I receive an email on my phone but cannot open the attachment with my application ... BUT if I will send an email to the same account and open it on my PC (with Thunderbird), and not on the phone, and then forward it or send it as a new email to my phone, I can use the same email application on phone to open the application with my APPENDIX ... I am only talking about one e-mail account here, the only difference is,where the email was sent from, my phone or my Windows 7 PC.
The only thing I can think of is that when I send an email from the phone, a different mime type is embedded in the application than when I send it from Thunderbird on my PC ... I specify the mime type as "application / octet- stream "when I send a message from my application, and I have an intent filter that searches for this mime type ... but it does not work correctly.
My intent filter:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/octet-stream" />
<data android:scheme="file" />
</intent-filter>
The purpose that I pass to the phones email client when sending a file in the email application from the phone:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("application/octet-stream");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + fullPathString));
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "FiberDroid OTDR Trace File: \"" + ContextMenuFileName + "\"");
sendIntent.putExtra(Intent.EXTRA_TEXT, "This e-mail was sent from the TTI FiberDroid Android application.");
startActivity(Intent.createChooser(sendIntent, "Select E-Mail Application"));
, ... (, outlook thunderbird), . , , , , , , - " SD-"...
, , , , ( ), , , , , .
? .