you should have close()d the PrintWriter, instead of the IOStream. Thats all
Am Sonntag, 27. Februar 2011 23:17:29 UTC+1 schrieb davemac:
>
> Both of these classes have a dump() method which looks useful for
> debugging. I tried to use them in a sample application, but I'm not
> getting any output at all. My code looks like this from within my
> activity:
>
> public void dumpFragmentMgr() {
> FragmentManager fm = getFragmentManager();
> File dumpFile = new
> File(Environment.getExternalStorageDirectory() +
> "/fmdump.txt");
> if(dumpFile.exists()) {
> dumpFile.delete();
> }
> try {
> FileOutputStream fos = new FileOutputStream(dumpFile,
> true);
> fm.dump("DIALOG", fos.getFD(), new PrintWriter(fos),
> null);
> fos.flush();
> fos.close();
> } catch (FileNotFoundException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
> I'm positive that I have fragments in my fragment manager. My output
> file is always empty, although I can see the datetimestamp getting
> updated. I'm always passing null for the 4th argument to dump() since
> I have no idea what else to put there. I have enableDebugLogging set
> to true. Any help please?
>
--
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