public void borrarElementos(String[] ficheros2) { List<Score> elementosAEliminar = new ArrayList<Score>(); for (int i = 0; i < ficherosLength(); i++) { if (mSelected.containsKey(i)) { f_toDelete = new File(Environment.getExternalStorageDirectory() + path + ficheros2[i]); f_image_toDelete = new File( Environment.getExternalStorageDirectory() + image_path + MSUTILS.ficheroAImagen(ficheros2[i])); if (f_toDelete.exists() && f_image_toDelete.exists()) { if (f_toDelete.delete() && f_image_toDelete.delete()) { elementosAEliminar.add(s_adapter.getItem(i)); delete = true; } else { delete = false; break; } } } } s_adapter.removeAllSelected(elementosAEliminar); numScores = scores_gallery.getCount(); if (delete) { Toast.makeText(getApplicationContext(), R.string.successDelete, Toast.LENGTH_LONG).show(); } else { Toast.makeText(getApplicationContext(), R.string.failDelete, Toast.LENGTH_LONG).show(); } if (s_adapter.isEmpty()) { new InterfazNoPartituras(ctx, scores_gallery); } mSelected.clear(); }
@Override public boolean onQueryTextSubmit(String text) { if (s_adapter != null) s_adapter.filter(text); return false; }
/** * *************************************************Bloque * filtro*********************************** */ @Override public boolean onQueryTextChange(String newText) { if (s_adapter != null) s_adapter.filter(newText); return false; }