new Thread(new Runnable() { @Override public void run() { try { Bitmap bitmap = Glide.with(MenuEditingActivity.this) .load(HttpContants.URL + image) .asBitmap() .into(200, 200) .get(); if (bitmap != null) uploadImage(bitmap); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } }).start();
注意:必须在子线程运行。