Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new MasterClickAsyncTask(main).execute(position);
- import java.io.IOException;
- import java.net.MalformedURLException;
- import org.json.JSONException;
- import android.os.AsyncTask;
- import android.os.Looper;
- import android.view.View;
- public class MasterClickAsyncTask extends AsyncTask<Integer, Void, Void> {
- Master selectedMaster;
- Main main;
- MasterGridView masterGridView;
- Integer i;
- DiscogProxy discogProxy = new DiscogProxy();
- MasterClickAsyncTask(Main main){
- this.main = main;
- this.masterGridView = main.getMasterGridView();
- }
- @Override
- protected void onPreExecute() {
- main.progressBar.setVisibility(View.VISIBLE);
- }
- @Override
- protected Void doInBackground(Integer... params) {
- masterGridView.getSelectedView();
- Globals.selectedMaster = (Master)(masterGridView).getItemAtPosition(params[0].intValue());
- Globals.selectedMaster.getVersionListView().getVersionList().clear();
- Looper.prepare();
- try {
- Globals.selectedMaster.getVersionListView().populateVersionList();
- } catch (MalformedURLException e) {
- e.printStackTrace();
- } catch (JSONException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- //Looper.getMainLooper().quit();
- return null;
- }
- @Override
- protected void onPostExecute(Void result) {
- main.populateAlbumVersionsView();
- main.progressBar.setVisibility(View.GONE);
- }
- }
- if (Looper.myLooper()==null)
- Looper.prepare();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement