I have an interface that has a static key. And I wanted to retrieve this key from a string file, but if I just put R.string.key, it shows incompatible types, because it retrieves the integer value, and if I put R.string.key + "", it becomes a string but retrieves the String file id, it would be best to use getResources.getString (R.string.key), but there is no way to use the getResources.getString method in the Interface.
Working:
public interface NotificacaoService {
@Headers({"34853485734",
"Content-Type:application/json"}) @POST("send")
Call<NotificacaoDados> salvarNotificacao(@Body NotificacaoDados notificacaoDados);
}
I want to leave it like this:
public interface NotificacaoService {
@Headers({getResources.getString(R.string.key),
"Content-Type:application/json"}) @POST("send")
Call<NotificacaoDados> salvarNotificacao(@Body NotificacaoDados notificacaoDados);
}