On Fri, Jun 26, 2009 at 5:29 PM, Mark Murphy<[email protected]> wrote:
>
> silverburgh wrote:
>> I create a local file in my activity like this:
>>
>> File f = getFileStreamPath("mypicture");
>>
>> How can I pass the URI of this file to another Activity?
>
> If the other activity is one in your application, just tell it the path
> from the File object, or the relative path you started with.
>
> If the other activity is outside your application, you can use
> File#getAbsolutePath() to get the fully-qualified path.
>
>> And do I need to set any permission (file permission, manifest
>> permission) to allow other Activity to use that file?
>
> You can try MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE with
> openFileOutput() when you create the file, but I have not tried these.
> By default, other applications cannot access your file in your app-local
> file storage area.
Thanks. But I need help in combine your 2 ideas together.
In creating file using MODE_WORLD_READABLE , it returns a reference of
FileOutputStream, not File, how can i get call the getAbsolutePath?
File#getAbsolutePath() to get the fully-qualified path.
try {
FileOutputStream fos = openFileOutput
("temp-picture",
MODE_WORLD_WRITEABLE);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Need help for your Android OSS project? http://wiki.andmob.org/hado
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---