diff --git a/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java index 618075a..1d99f51 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/fragments/ConversationsListFragment.java @@ -375,17 +375,22 @@ public class ConversationsListFragment extends Fragment implements AdapterView.O * @param convID The ID of the conversation to delete */ private void delete_conversation(final int convID){ - new AsyncTask(){ + new AsyncTask(){ @Override - protected Void doInBackground(Void... params) { - conversationsListHelper.delete(convID); - return null; + protected Boolean doInBackground(Void... params) { + return conversationsListHelper.delete(convID); } @Override - protected void onPostExecute(Void aVoid) { + protected void onPostExecute(Boolean result) { refresh_conversations_list(); + + //Display a toast if an error occurred + if(!result) + Toast.makeText(getActivity(), + R.string.fragment_conversationslist_err_del_conversation, + Toast.LENGTH_SHORT).show(); } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); }