Following warning is shown in my project -
Unchecked call to 'getWeatherData(T,Boolean,String)' as a member of raw type 'IWeatherCallbackListener'.
I have created following interface -
public interface IWeatherCallbackListener<T> {
void getWeatherData(T weatherModel, Boolean success, String errorMsg);
}
And called it in following way,
public class WeatherConditions {
private static IWeatherApi mWeatherApi;
/**
* @param city
* @param appId
* @param listener
*/
public static void getOpenWeatherData(String city, String appId, IWeatherCallbackListener listener) {
mWeatherApi = ApiService.getRetrofitInstance(BASE_URL_OPEN_WEATHER).create(IWeatherApi.class);
Call<OpenWeatherModel> resForgotPasswordCall = mWeatherApi.getOpenWeatherData(appId, city);
resForgotPasswordCall.enqueue(new Callback<OpenWeatherModel>() {
@Override
public void onResponse(Call<OpenWeatherModel> call, Response<OpenWeatherModel> response) {
if (response.body() != null) {
if (listener != null)
listener.getWeatherData(response.body(), true, "");
}
}
@Override
public void onFailure(Call<OpenWeatherModel> call, Throwable t) {
if (listener != null)
listener.getWeatherData(null, false, t.getMessage());
}
});
}
I have implemented this interface in my MainActivity and called the method as -
WeatherConditions.getOpenWeatherData(etCityName.getText().toString(), OPEN_WEATHER_APP_ID, MainActivity.this)
Can anyone please help and explain this warning.