私のプロジェクトには、引き出しライブラリheinrichreimersoftware'Material drawer libraryを使用しています。引き出しアイテムのURLから画像を読み込むには、私は滑空を使用しています。AndroidのDraweritemでuriのアイコン/アバターを読み込む方法
final ImageView image = new ImageView(this);
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
Looper.prepare();
try {
theBitmap = Glide.
with(MainActivity.this).
load(FirebaseAuth.getInstance().getCurrentUser().getPhotoUrl()).
asBitmap().
into(-1,-1).
get();
} catch (final ExecutionException e) {
Log.e(TAG, e.getMessage());
} catch (final InterruptedException e) {
Log.e(TAG, e.getMessage());
}
return null;
}
@Override
protected void onPostExecute(Void dummy) {
if (null != theBitmap) {
// The full bitmap should be available here
image.setImageBitmap(theBitmap);
Log.d(TAG, "Image loaded");
};
}
}.execute();
drawer.addItem(new DrawerItem()
.setImage(this,theBitmap)
.setTextPrimary(getString(R.string.profile))
);
しかし、それはイメージをロードしていない、すべてのヘルプはImageViewの中に画像の読み込みのためのコードの下
私の回答を参照してください私はこれがあなたを助けることを望む。 –