ApiInterface
public interface ApiInterfaceTemp
{
@GET("bf10b0f9631a80747ebfe6a674c0/37.8267,-122.4233")
Call<TempDbDailyData> getTopRatedMovies();
}
Mainactivity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView) findViewById(R.id.temp_new);
ApiInterfaceTemp apiInterfaceTemp = ApiClientTemp.getClient().create(ApiInterfaceTemp.class);
Call<TempDbDailyData> call = apiInterfaceTemp.getTopRatedMovies();
call.enqueue(new Callback<TempDbDailyData>()
{
@Override
public void onResponse(Call<TempDbDailyData> call, Response<TempDbDailyData> response)
{
String temp = response.body().getSummary();
textView.setText(temp);
}
@Override
public void onFailure(Call<TempDbDailyData> call, Throwable t)
{
Log.e(TAG, t.toString());
}
});
}
我在这里添加了mainactivity和Api。获取变量temp的空值。请告诉我哪里出错了