07-08 01:45:41.080: D/dalvikvm(11371): GC_CONCURRENT freed 125K, 8% free 12454K/13511K, paused 17ms+15ms, total 64ms
07-08 01:45:41.570: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-08 01:45:41.570: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-08 01:45:51.065: W/System.err(11371): java.io.FileNotFoundException: /data/data/hasebou.karim.simplify/cache/Details.txt: open failed: EISDIR (Is a directory)
07-08 01:45:51.065: W/System.err(11371): at libcore.io.IoBridge.open(IoBridge.java:416)
07-08 01:45:51.065: W/System.err(11371): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
07-08 01:45:51.065: W/System.err(11371): at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
07-08 01:45:51.065: W/System.err(11371): at java.io.PrintWriter.<init>(PrintWriter.java:127)
07-08 01:45:51.065: W/System.err(11371): at hasebou.karim.simplify.TimedEventsListFragment.saveFiles(TimedEventsListFragment.java:57)
07-08 01:45:51.065: W/System.err(11371): at hasebou.karim.simplify.TimedEventsListFragment.addToList(TimedEventsListFragment.java:48)
07-08 01:45:51.065: W/System.err(11371): at hasebou.karim.simplify.Volume.onOptionsItemSelected(Volume.java:104)
07-08 01:45:51.065: W/System.err(11371): at android.app.Activity.onMenuItemSelected(Activity.java:2629)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1047)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:586)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:162)
07-08 01:45:51.070: W/System.err(11371): at android.view.View.performClick(View.java:4223)
07-08 01:45:51.070: W/System.err(11371): at android.view.View$PerformClick.run(View.java:17275)
07-08 01:45:51.070: W/System.err(11371): at android.os.Handler.handleCallback(Handler.java:615)
07-08 01:45:51.070: W/System.err(11371): at android.os.Handler.dispatchMessage(Handler.java:92)
07-08 01:45:51.070: W/System.err(11371): at android.os.Looper.loop(Looper.java:137)
07-08 01:45:51.070: W/System.err(11371): at android.app.ActivityThread.main(ActivityThread.java:4898)
07-08 01:45:51.070: W/System.err(11371): at java.lang.reflect.Method.invokeNative(Native Method)
07-08 01:45:51.070: W/System.err(11371): at java.lang.reflect.Method.invoke(Method.java:511)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
07-08 01:45:51.070: W/System.err(11371): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
07-08 01:45:51.070: W/System.err(11371): at dalvik.system.NativeStart.main(Native Method)
07-08 01:45:51.070: W/System.err(11371): Caused by: libcore.io.ErrnoException: open failed: EISDIR (Is a directory)
07-08 01:45:51.070: W/System.err(11371): at libcore.io.Posix.open(Native Method)
07-08 01:45:51.070: W/System.err(11371): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
07-08 01:45:51.070: W/System.err(11371): at libcore.io.IoBridge.open(IoBridge.java:400)
07-08 01:45:51.075: W/System.err(11371): ... 24 more
07-08 01:45:51.075: E/error occured(11371): java.io.FileNotFoundException: /data/data/hasebou.karim.simplify/cache/Details.txt: open failed: EISDIR (Is a directory)
07-08 01:45:51.335: D/AbsListView(11371): Get MotionRecognitionManager
07-08 01:45:51.355: D/dalvikvm(11371): GC_CONCURRENT freed 165K, 9% free 12708K/13831K, paused 12ms+3ms, total 35ms
07-08 01:45:51.540: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-08 01:45:51.540: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-08 01:45:51.565: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-08 01:45:51.565: E/SpannableStringBuilder(11371): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
File file = new File(mainAct.getCacheDir(), "Details.txt");
try {
if(file.createNewFile()){
Log.e("making file", " file made");
}
PrintWriter write = new PrintWriter(file);
String everyThing = s.name + "\n" +s.time + "\n" + s.onoff +"\n";
for(boolean b : s.daysofweek){
if(b == true){
everyThing += "1";
}
else{
everyThing += "0";
}
}
everyThing += "\n";
for(boolean b : s.sensors){
if(b == true){
everyThing += "1";
}
else{
everyThing += "0";
}
}
everyThing += "\n" + "End";
write.print(everyThing);
write.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.e("error occured", e.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
答案 0 :(得分:0)
是否有与您正在下载的文件同名的文件夹?
您可以尝试在使用以下内容创建文件PrintWriter
之前清除它:
new File(xxxx).delete();