Optimized layouts and bugfix
Optimized song and artist list item layouts Hopefully fixed a NPE when deleting a track
This commit is contained in:
parent
7c206f5423
commit
31f794336a
8 changed files with 28 additions and 39 deletions
|
|
@ -131,8 +131,8 @@ public class MusicUtil {
|
|||
cursor.moveToFirst();
|
||||
while (!cursor.isAfterLast()) {
|
||||
final String name = cursor.getString(1);
|
||||
final File f = new File(name);
|
||||
try { // File.delete can throw a security exception
|
||||
final File f = new File(name);
|
||||
if (!f.delete()) {
|
||||
// I'm not sure if we'd ever get here (deletion would
|
||||
// have to fail, but no exception thrown)
|
||||
|
|
@ -141,6 +141,8 @@ public class MusicUtil {
|
|||
cursor.moveToNext();
|
||||
} catch (final SecurityException ex) {
|
||||
cursor.moveToNext();
|
||||
} catch (NullPointerException e){
|
||||
Log.e("MusicUtils", "Failed to find file " + name);
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue