That should work fine. That function does very little -- just builds a File with the proper path.
You might want to attach the debugger and see the stack crawl when you are stuck. On Sun, Apr 5, 2009 at 2:37 PM, Richard Schilling < [email protected]> wrote: > > I'm getting some weird behavior when I try to open a file within a > service: > > <code> > > public class MyService extends Service{ > > public void onCreate(){ > super.onCreate(); > > File myFile = getFileStreamPath("myfile.dat"); > > if (myFile.exists()){ > Log.i("MyService", "myfile.dat exists"); > } > > } > > </code> > > Whenever getFileStreamPath is called, the service just freezes and > does nothing. It's like the call to getFileStremPath is being blocked > by something. > > Can someone give an example of how to properly obtain a File object > reference in a service using getFileStreamPath()? > > Thanks. > > Richard > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

