replace this:
String[] movie = questionstring.doInBackground();
String Title = movie[0];
String Year = movie[1];
String Released = movie[2];
String Director = movie[3];
String Actor = movie[4];
String Awards = movie[5];
String Genre = movie[6];
with this:
questionstring.execute();
String[] movie = questionstring.get();
the .get method waits until the async thread is finished so ideally you should do some other actions if applicable before calling .get straight away
alternate method:
myActivity act;
GetMovie(myActivity act){
this.act=act;
}
protected void onPostExecute(String[] result) {
act.setMovies(result);
super.onPostExecute(result);
}
create relevant methods in myActivity class like so:
global variable
GetMovie questionstring=null;
String[] movie;
on create:
questionstring = new GetMovie(this);
questionstring.execute();
on destroy:
onDestroy(){
if(questionstring!=null)questionstring.cancel(true);
super.onDestroy();
}
set movies:
public void setMovies(String[] mov){
movies=mov;
textView0.setText(mov[0]);
textView1.setText(mov[1]);
textView2.setText(mov[2]);
textView3.setText(mov[3]);
textView4.setText(mov[4]);
textView5.setText(mov[5]);
textView6.setText(mov[6]);
}