This is the code. I want put params EMAIL! But i get attribute value must be costant
public interface Api{
Context context=null;
SharedPreferences sharedPref = context.getSharedPreferences("login",Context.MODE_PRIVATE);
static String email = sharedPref.getString("email","");
@GET("Home.php?email="+email+"&")
Call<List<Variabili_Main>> getHome(@Query("page") int index);
}
Help me!
ok i have edit but now how edit this? And here what i do?
private void load(int index){
Call<List<Variabili_Main>> call = api.getHome(index);
call.enqueue(new Callback<List<Variabili_Main>>() {
@Override
public void onResponse(Call<List<Variabili_Main>> call, Response<List<Variabili_Main>> response) {
if(response.isSuccessful()){
movies.addAll(response.body());
adapter.notifyDataChanged();
}else{
Log.e(TAG," Response Error "+String.valueOf(response.code()));
}
}
@Override
public void onFailure(Call<List<Variabili_Main>> call, Throwable t) {
Log.e(TAG," Response Error "+t.getMessage());
}
});
}