I want to send an array of long numbers to the server, I get this array from the adapter recyclerview and then I want to send this array to the server. But for some reason I get an error:
java.lang.IllegalArgumentException: No Retrofit annotation found. (parameter #2) for method APIService.delete_several_message I understand from the error that the problem is in parameter 2, this is how this parameter looks in the interface:
Call<Delete_several_messages> delete_several_message(@Header("Authorization") String token, HashSet<Integer> k, @Query("type") int type); here is the class created for this process:
public class Delete_several_messages { @SerializedName("ids") @Expose private Set <Integer> [] ids; public Set <Integer> [] getIds() { return ids; } } and that's how I call everything in the main class:
mAPIService.delete_several_message("Bearer " + a_token,checked,2).enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { } @Override public void onFailure(Call call, Throwable t) { } }); Here is this part:
mAPIService.delete_several_message("Bearer " + a_token,checked,2) highlighted in yellow, and the message hangs there: unchecked call to .enqueue(CallBack<T>)...
The call occurs in the method that is attached to the button click:
private void deleteGroup(HashSet checked) This is where and how this method is registered when you press the button:
deleteBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MessageCenter.this, String.valueOf(ListAdapter.getChecked()), Toast.LENGTH_SHORT).show(); deleteGroup(ListAdapter.getChecked()); } }); This set comes from the adapter.
I honestly say the first time a similar problem occurs, most often requests are sent normally. What could be the problem, besides the one that sits in front of the computer?)
Delete_several_messages? And what are you sending him ... - woesss@Body- woesss