Skip to content

Commit

Permalink
Fix bug that cannot search movie after auto login.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheng-Xuan committed Feb 14, 2017
1 parent 9aa0668 commit 33d01d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onClick(View v) {
}
else {
searchTask = new SearchTask();
searchTask.execute(etSearch.getText().toString(),getActivity().getIntent().getExtras().getString("Token"));
searchTask.execute(etSearch.getText().toString(), getActivity().getIntent().getExtras().getString("Token").trim());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public SearchRequestHttpBuilder(String keywords, String token){
}

public Request getRequest() {
return new Request.Builder().url(url).header("title", keywords).addHeader("Authorization", "Bearer "+ token).build();
return new Request.Builder().url(url).header("title", keywords).addHeader("Authorization", "Bearer "+ token.trim()).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

Intent homePageIntent = new Intent(this, HomePageActivity.class);
// pass token to the new activity
Bundle bundle = new Bundle();
bundle.putString("Token", token);
homePageIntent.putExtras(bundle);
homePageIntent.putExtra("Token", token);
this.startActivity(homePageIntent);
finish();

Expand Down

0 comments on commit 33d01d6

Please sign in to comment.