april wrote:
> How can I get the directory of the file? If I need to read it back
> from media player?
>
>
> FileOutputStream fos=null;
> OutputStream out=null;
> try
> {
>
> fos=mActivity.openFileOutput(fName,mActivity.MODE_WORLD_WRITEABLE );
> out =(OutputStream)(fos);
> out.write(s.getBytes());
> out.close();
> fos.close();
> out=null;
> fos=null;
> }
> catch(Exception e)
> {
> // AlertDialog.show(, title, iconId, message, button1Text,
> button1Listener, button2Text, button2Listener, cancelable,
> cancelListener)
> }
Call getFilesDir() on your activity. Quoting from the documentation:
"Returns the absolute path to the directory on the filesystem where
files created with openFileOutput(String, int) are stored."
--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.3 Published!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---