AsyncHttpClient client = new AsyncHttpClient();
btnSearch.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText edtName = findViewById( R.id.edtName );
AsyncHttpClient client = new AsyncHttpClient();
String name = edtName.getText().toString();
String url = "http://www.omdbapi.com/?i="+name+" &apikey=";
client.get(url, new JsonHttpResponseHandler() {
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
try {
title.setText( response.getString( "Title" ) );
year.setText( response.getString( "Year" ) );
genre.setText( response.getString( "Genre" ) );
director.setText( response.getString( "Director" ) );
writer.setText( response.getString( "Writer" ) );
actors.setText( response.getString( "Actors" ) );
plot.setText( response.getString( "Plot" ) );
lang.setText( response.getString( "Language" ) );
country.setText( response.getString( "Country" ) );
poster.setText( response.getString( "Poster" ) );
awards.setText( response.getString( "Awards" ) );
rating.setText( response.getString( "Rating" ) );
website.setText( response.getString( "Website" ) );
} catch (JSONException e) {
e.printStackTrace();
}
}
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
}
});
}
});
}
}
Это мой проект. когда я набираю mov ie name и нажимаю на кнопку поиска, я хочу показать детали фильмов из omdb api, но ничего не отображается. Почему?