Show error message when sort can't be done

This commit is contained in:
J-Jamet
2018-07-15 10:33:54 +02:00
parent 2ab81ed77c
commit f6c61ab407

View File

@@ -34,6 +34,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.kunzisoft.keepass.R;
import com.kunzisoft.keepass.app.App;
@@ -124,10 +125,12 @@ public class NodeAdapter extends RecyclerView.Adapter<BasicViewHolder> {
public void rebuildList(PwGroup group) {
this.nodeSortedList.clear();
assignPreferences();
// TODO verify sort
try {
this.nodeSortedList.addAll(group.getDirectChildren());
} catch (Exception e) {
Log.e(TAG, "Can't add node elements to the list", e);
Toast.makeText(context, "Can't add node elements to the list : " + e.getMessage(), Toast.LENGTH_LONG).show();
}
}