> I don't think FLAG_GRANT_READ_URI_PERMISSION is helping you any, since you
> don't have a Uri in this Intent.
It's in there, Mark. It was obscured by clouds of bad format:
sendIntent.setType("text/csv");
FileOutputStream fos = this.openFileOutput(FILENAME,
Context.MODE_WORLD_READABLE);
fos.write(msg.getBytes());
fos.close();
sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(getFileStreamPath(FILENAME)));
sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
I figured out that I did need to make the file MODE_WORLD_READABLE,
but I'm not sure if I ever tested whether I needed the URI permission.
So, to sum up: the GMail client is something different and is pretty
common, and we don't have the same control over it as the built-in
client.
Is there a phone out there that wouldn't let me write a 100K file to
the internal file space? Also, do you know if I can count on the email
client having finished with the file when I resume my activity that
kicks off the ACTION_SEND?
Thanks again, Mark.
On May 16, 12:57 pm, Mark Murphy <[email protected]> wrote:
> Brion Emde wrote:
> > She reports that she's using the GMail
> > client. I'm not clear on what that is.
>
> The Gmail client is, well, the Gmail client. It's a client for Gmail,
> Google's email service. You'll see an icon for it in your device, most
> likely, though it is not available in the emulator.
>
> >
> > sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
>
> I don't think FLAG_GRANT_READ_URI_PERMISSION is helping you any, since
> you don't have a Uri in this Intent.
>
> > } catch (FileNotFoundException e) {
> > Log.e(TAG, getString(R.string.title_error));
> > Toast.makeText(this, getString(R.string.title_error),
> > Toast.LENGTH_SHORT).show();
> > e.printStackTrace();
> > } catch (IOException e) {
> > Log.e(TAG, getString(R.string.title_error));
> > Toast.makeText(this, getString(R.string.title_error),
> > Toast.LENGTH_SHORT).show();
> > e.printStackTrace();
> > }
>
> You may wish to upgrade your error reporting, to use something that is
> going to give you exception data from the field:
>
> http://www.androidguys.com/2009/11/16/diagnosing-sporadic-errors/
>
> Once you have the exception in hand, figuring out what is going wrong
> may become far simpler.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group
> athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en