agit
agit copied to clipboard
Agit crashes when sdcard unavailable (e.g. mounted as storage)
Reported by estliberitas on the Android Market:
I recently installed yr app, and it crashes each time I try to start it. :) Update: it crashes when device is connected to PC as SD card.
This is because Agit expects to find all repos at [sdcard]/git-repos - if the sdcard isn't available, we should show the user a friendly warning instead of crashing,
So, waiting 4 update in market! :)
Thanks for the poke :-) I'm in the middle of a difficult refactoring at the moment but yeah, I'll try to get a fix for this issue out with the next release.
Wow, the commit mentioning is pretty nice. This isn't done yet, and I haven't been able to test it, but the functionality should be there to check for the external state, all that needs happen now is to fail gracefully where noted.
The following link is where I stole from wholesale. Might be worthwhile to set up a similar check on startup and set a flag for whether or not the media is mounted, then check that flag whenever you need to get at the SD card. I noticed quite a few file reads. http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29