SHARE
TWEET

Untitled

a guest Nov 14th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class AsyncTaskMaxPage extends AsyncTask<ComicsPage, Void, ComicsPage> {
  2.  
  3.  
  4.         @Override
  5.         protected ComicsPage doInBackground(ComicsPage... params) {
  6.             params[0].uploadMaxPage();
  7.             return params[0];
  8.         }
  9.  
  10.         @Override
  11.         protected void onPostExecute(ComicsPage page) {
  12.         }
  13.     }
  14.  
  15. public void uploadMaxPage() {
  16.         maxPage = FindComicsImage.makeMaxPage(this.urlCurrentPage);
  17.     }
  18.  
  19. public static int makeMaxPage(String url) {
  20.         try {
  21.             Thread.sleep(1000);
  22.         } catch (InterruptedException e) {
  23.             e.printStackTrace();
  24.         }
  25.         String httpContext = makeHttpContext(url);
  26.         int maxNumber = maximumPage(httpContext);
  27.         return maxNumber;
  28.     }
  29.  
  30.             AsyncTaskMaxPage asyncTaskMaxPage = new AsyncTaskMaxPage();
  31.                 asyncTaskMaxPage.execute(enteredComics);
  32.  
  33.                 int maxPage = enteredComics.getMaxPage();
RAW Paste Data
Top