Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. new MasterClickAsyncTask(main).execute(position);
  2.  
  3. import java.io.IOException;
  4. import java.net.MalformedURLException;
  5. import org.json.JSONException;
  6. import android.os.AsyncTask;
  7. import android.os.Looper;
  8. import android.view.View;
  9.  
  10. public class MasterClickAsyncTask extends AsyncTask<Integer, Void, Void> {
  11.  
  12. Master selectedMaster;
  13. Main main;
  14. MasterGridView masterGridView;
  15. Integer i;
  16. DiscogProxy discogProxy = new DiscogProxy();
  17.  
  18. MasterClickAsyncTask(Main main){
  19. this.main = main;
  20. this.masterGridView = main.getMasterGridView();
  21. }
  22.  
  23. @Override
  24. protected void onPreExecute() {
  25. main.progressBar.setVisibility(View.VISIBLE);
  26. }
  27. @Override
  28. protected Void doInBackground(Integer... params) {
  29. masterGridView.getSelectedView();
  30. Globals.selectedMaster = (Master)(masterGridView).getItemAtPosition(params[0].intValue());
  31. Globals.selectedMaster.getVersionListView().getVersionList().clear();
  32. Looper.prepare();
  33. try {
  34. Globals.selectedMaster.getVersionListView().populateVersionList();
  35. } catch (MalformedURLException e) {
  36. e.printStackTrace();
  37. } catch (JSONException e) {
  38. e.printStackTrace();
  39. } catch (IOException e) {
  40. e.printStackTrace();
  41. }
  42. //Looper.getMainLooper().quit();
  43. return null;
  44. }
  45.  
  46. @Override
  47. protected void onPostExecute(Void result) {
  48. main.populateAlbumVersionsView();
  49. main.progressBar.setVisibility(View.GONE);
  50. }
  51. }
  52.  
  53. if (Looper.myLooper()==null)
  54. Looper.prepare();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement